Want to Loop If and Else

I’m trying to Loop an If and Else statements…
Simply put i want to check a value on the web page and check its visible and click it…
If its not visible I want it to click another page and then return and check the value…
This needs to loop until the item becomes visible, and it can take over 2 hours to return…

I think you can use a similar command to wait for the element visible as following and then perform the action from it.

WebUI.waitForElementClickable(findTestObject(‘UI Test Objects/Pages/Master Page/elCreate’), 0)

i can’t use it as the page doesn’t automatically refresh. Thats the issue.

So when will the page get refreshed or a user need to do anything to make it refreshed?
I am a little bit confused on the testing flow.

Can you try putting this inside your for loop:

WebUI.waitForElementVisible(’<YOUR_WEB_ELEMENT’, 2, FailureHandling.CONTINUE_ON_FAILURE)


The user is required to manually click off the page then back on… (not a product design I like)

Hey Rich

It might be clear enough to you, but your description leads to multiple questions… and rather than ask them here, I thought maybe a different approach might get us there quicker.

Write out a list of steps, in English, one step per line, showing exactly what you’re expecting the code to do. Here’s a start:

Start of loop

  <steps here>

End of loop

If you do that, I’m sure I (we) can pull something together for you (however crazy the page/site design might be).


“It’s software. What part of soft don’t you understand?”

1 Like