Ask a Question

If object exist, click the button if not move on

MarcusBengtsson
Contributor

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)

MarcusBengtsson_0-1669388016701.png

 

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

MarcusBengtsson_1-1669388086558.png

 

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

MarcusBengtsson_2-1669388263980.png

 

 

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

 

 

3 REPLIES 3
rraghvani
Valued Contributor

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

rraghvani_0-1669392838316.png

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

rraghvani_1-1669392851974.png

 

You need to check the property of your UI Object.

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 🙂 

 

MarcusBengtsson_0-1669621427356.png

 

rraghvani
Valued Contributor

See Compare Properties Operation, which can be used in the if statement.

 

 

 

cancel
Showing results for 
Search instead for 
Did you mean: