Forum Discussion

MarcusBengtsson's avatar
Frequent Contributor
2 years ago

If object exist, click the button if not move on

Hello! Been driving me nuts the last hours trying with different positions of the if object / else and without it etc but cant get it to work..

Will try to explain here as good as I can.


I am going to Links tab in my web application, it can sometimes be that 1 parameter + monitoring configuration is checked and sometimes they are unchecked, if they are unchecked a validation error will appear. That validation error message I have an If object exist on as shown in the image below..


However if the validation error does not exist I want to click on the OK button (not shown in the image) to save the test.



This is how it looks in my keyword tests at the moment (as mentioned tried lots of different positions, with and without else etc)


The If object "LinksvalidationStatus" and "Monitoringvalidatio" is the text marked in red as shown below:


How it looks with no validation errors and both configurations checked.



When ever I come to this page and it runs the "if object" for these 2 if they exist



3 Replies

  • rraghvani's avatar
    Champion Level 3

    In HTML, you have code that creates the UI object, and you have properties that define the UI Object. Since the object is already created, and the property for visibility is set to false. TC will see the object, so when calling the Exists method, it will return true. 


    For example, I have a validation message appearing, property Exists = true and Visible = true

    When the validation disappears, property Exists = true but Visible = false


    You need to check the property of your UI Object.

    • MarcusBengtsson's avatar
      Frequent Contributor

      Ahhhh thats great! How.. do I select the "visibleonscreen" option? that thing actually changed from true to false, all other are still true even if checked or not. If its possible 🙂