-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot handle pop up window #42
Comments
i see the issue for this checkup keywords. All checkup keyword should return False if an Element does not Exists or the condition is false. This is only for the keyword handling by Is Keyword the case. I will rework on this type of keywords and change the handling. By the current status you can use a combination from core keywords by robotframework to get the correct status https://robotframework.org/robotframework/latest/libraries/BuiltIn.html#Run Keyword And Return Status Run Keyword And Return Status |
Sorry for the late request. I started to reevaluate your issue. What you want to check is that an error popup is showing if input data is wrong. Here we got now an issue on robotframework 4. The xpath does not exists and all keywords work like expected that they fail on your side because they can not verify your respose. Your approaches are right. You have to combine them with Keyword And Return Status
By this combination you should checkup the input data and result. If it's failed because the xpath is not found because no error message popup it returns False so your input data is correct them. The issue is here that the result is not a simple bool anymore because you have three states (Element does not exists (True) | Element exists (True) | Xpath not found (Error) It's not a good design to combine error statements with return logic. What you want is similar code :
This syntax will be available in robotframework 5 and i will extend the error handling by these exception blocks to create such a code on your test script for a better readablity. |
In upcoming release: New Syntax
|
Describe the bug
I have a desktop application screen that throws an error when you dont provide data as expected, unfortunately I dont see an automation id for this screen but I do see automation Id for a OK button on it.
I want to check in my script if this error pop up occured and I want to fail the test case in case of wrong data. If provided with correct data the pop up wont show and test cases should continue.
I tried 3 keywords:
Is Element Enabled //[@AutomationId='OkButton']
Element should not be Visible //[@AutomationId='OkButton']
Element should not Exist //*[@AutomationId='OkButton']
It does executes well is there is an error pop up coming up but when the data is clean the code fails throwing error Xpath not found or it would hang the project in pycharm and would work only when I restart everything
Code snippets
${ISErrPopupVisible} Is Element Enabled //*[@AutomationId='OkButton']
IF '${ISErrPopupVisible}'=='True'
Fail There is an issue with Input Data
ELSE
Log You have input correct data, please wait for the ouput to be generated
END
The text was updated successfully, but these errors were encountered: