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}

2 Likes

Hey,

The web page has a element as ‘//tbody/tr[1]/td[3]/a[1]’ which is visible in some times after 5 sec and some times after 60sec. So I want to refresh the page in 5sec of intervals to check if the element is visible or not. If the element is visible then click on it else repeat the steps till the element is visible.

Please suggest how can I do that please.

1 Like