Wait for Button and for second page load

Hi!

I have 2 cases where my flow needs to wait for an event to happen until it can do it´s next task:

  1. Wait until a button in a popup changes from greyed out to normal color (disabled to enabled ?) to then click it. The waiting takes between 1 second and 5 minutes.

  2. After a click on a button a new page get´s loaded. This page stayes between 10seconds and 5min. Then it automatically loads a new page. Now I want to let my flow wait after the click on the button until that second page has loaded and then continue to the next task.

As the normal ClickandWait or WaitFor… do not work:
Which command or set of commands do I need to use to accomplish this?

Thanks!

Sascha

There is a command to check colors but in your case you can simply wait for an image to appear. The test image would be a screenshot of the enabled button.

To wait for an image to appear use:

  • store | 360000 | !timeout_wait <- tell visualAssert to wait up 6 minutes for the image to show. The default value is 60s (one minute).
  • visualAssert | image_of_button_normal_color.png <- this automatically waits for the image to appear. It re-checks every second until !timeout_wait limit.

Here you can again use visualAssert to visually check if the new page is loaded. This time with a test image specific/unique to this new page, of course.

PS: All visual commands with image input (XClick, XClickRelative, visualAssert, visualVerify) automatically wait for the image to appear until the !timeout_wait time is reached. I used visualAssert here because it seems best suited for your case.

PPS: For more complicated image-triggered workflows see If {picture} then {do this}

1 Like