cancel
Showing results for 
Search instead for 
Did you mean: 

Wait until Browser Page Refresh is Complete?

JonathanPeters
Level 2

Hi,

We have an object that changes a dropdown list on a web portal (open in an Edge browser window). The change triggers a page refresh (I'm explaining this for completeness, though actually just sending an F5 to the window would raise the same issue).

The issue we have is - How can the object 'know' when the page has refreshed? A wait stage based on "Parent document loaded = True" doesn't cause a wait, since the page was already loaded prior to the refresh. Similarly a Wait stage looking for the presence of any element will meet the conditions immediately since the element is already there. The issue boils down to having to wait for a 'change', yet when there are no updates for the page to show, nothing will actually change when a refresh happens. What ever hook you look for, it's already there.

When the page actually redraws (typically 5-10 seconds after the refresh is requested), the page content does, very momentarily, disappear and reappear. Therefore we've tried having a cascaded pair of Wait stages, "Wait for page/element to NOT be there" followed by "Wait for it TO be there (again)". This works about 95% of the time, but Wait stages must presumably be checking their condition(s) on a loop, and sometimes it misses the split second when the page/element is missing before it's re-drawn. Thus the first part of the cascaded Wait just times out waiting for the page to NOT be present (because it missed it).

The blunt way out of this seems to be to put in a dumb 10 second wait. But is there a better way?

3 REPLIES 3

ÖzençGezgin
Level 4

Hi @JonathanPeters

You can add wait stage that element exist before you made an action (Write or click) or You can add wait stage that latest loading element exist.

Have a nice day...

JonathanPeters
Level 2

Thank you for responding, but as I mentioned in the question, all the elements or conditions you might wait for *already exist*. As far as Blue Prism is concerned, the page looks identical before and after the refresh. Therefore the Wait stage won't wait for anything - all its conditions are already met. A human operator would see the page disappear briefly and then re-draw, and would instinctively know the page had re-downloaded, even if it was all the same data on that page. But I cannot find a way to program the robotic process to 'see' the refresh process has occurred and completed.

Hi,

Can the approach be inverted? Meaning:

Page loads 

When the page reloads, something disappears and reappears

Therefore, if we wait for say a control or a label to disappear and reappear after the initial page load, maybe that would confirm that the page has reloaded?

thanks