cancel
Showing results for 
Search instead for 
Did you mean: 

Wait for Page Load - Microsoft Edge

sarthak_86
Level 5
Hi There,

I want to check whether my webpage is loaded or not in Microsoft Edge.

In IE we were having functionality to check Page loaded in the wait stage.

So, looking for any approaches to check if the page is loaded and then search for the element in the webpage.

Thanks,
Sarthak

------------------------------
Sarthak Dhasmana
------------------------------
1 BEST ANSWER

Helpful Answers

Have you tried using a conditional Wait Stage with Parent Document Loaded? I know there's no Document Loaded in Chrome/Edge automation. It does blow my mind that Blue Prism did not make browser automation be consistent with actions and such available in IE automation, such as the lack of Match Reverse and Document Loaded options. Anyway, The goal of Parent Document Loaded is to wait for two things: (1) the target element to exist and (2) the page to finish loading. The ideal situation to handle what you're going for, I think, is to use a Navigate Stage or w/e to trigger the page reload then use a very small static/arbitrary wait stage afterward or even put the wait directly in the Navigate Stage (let's say 2 seconds to be safe) and then immediately after that have another wait stage that is conditional and uses Parent Document Loaded. Even though this is waiting for the same page, it "ideally" should wait for the page to finish loading because that's part of the functionality of Parent Document Loaded.

There's something important here I've found that can be very important. The element you choose to use in the Wait stage can affect whether the wait stage truly waits for the full page to load or not. What I've found to work well (and this is kind of standard in blue prism anyway) is to choose an element that should take the longest to load and then use Parent Document Loaded on that element. The reason this is important is especially in web pages with iframes and other similar constructs where waiting for an element in the wrong container could cause Blue Prism to not realize the page is technically still loading.

And then in the worst case if the above doesn't work, you may just want to put in a static wait like you said but use a loop so it can check periodically for results or whatever it's looking for and have a max loop limit of some kind to govern how many times it checks. It's not perfect, but it works ok for me.

------------------------------
Dave Morris
Cano Ai
Atlanta, GA
------------------------------

Dave Morris, 3Ci at Southern Company

View answer in original post

6 REPLIES 6

PabloSarabia
Level 11
Hi @sarthak_86

The best way to check if the page is loaded is using Wait Stage.

There is no "browser status" or similar.

If you want to write or read over any step, check these fields with Wait Stage.


Hope this helps you.

See you in the community, bye 🙂

------------------------------
Pablo Sarabia
Architect
Altamira Assets Management
Madrid
------------------------------

Thanks, @PabloSarabia for the inputs, but the main issue is that only there is no difference in the 2 pages, in the time it refreshes bot is able to identify the element as it is still visible.

Let me explain it with an example, we have the google homepage open and the element to use is the search icon, if we refresh the page, bot will still be able to find the search icon if the page is loading as it's visible on the screen. But the right working should be that it should wait for the page to load and then look for the element.

So, I am looking for any condition that can help us to wait for the Page load check.

Sarthak Dhasmana


------------------------------
Sarthak Dhasmana
------------------------------

diane.sanzone
Level 7
Hi Sarthak,

If you're refreshing the page, there has to be something that you're waiting for to change, right?  It it possible that instead of using your wait stage to check exists = True, you could instead do check exists = False?  In keeping with your example, if you've searched for something on the Google search page and identified the result is present, then you click to refresh to start clean with a new search, can you check to make sure that the prior result is no longer present or that your result count has changed from "over 300,000" to 0?  You might have to jump through some hoops to read text or something else to be sure the prior element is no longer there, but it should be possible.  Alternatively does the URL change in any way on the page reload?  I've seen similar situations where selecting a drop down makes an element visible that was previously hidden, but the remainder of the page remains the same.  The URL bar, however, appends some characters on reload.

To simplify, I recommend finding anything at all that is different between your "before" and "after" pages, then find a way to make Blue Prism identify the point when that changes, and don't forget that "check exists" has a True/False parameter that can be helpful to use!

Hope this helps and good luck.

------------------------------
Diane Sanzone
------------------------------

Thanks, Diane for the explanation, this google search thing I gave as an example, what basically in my bot is happening is that it is opening a page and then inputting some filters and then after submitting the page, it will load again with results. The only difference I see is in the result, but the issue with that is that the result is dynamic and can change always. Also, if I try to compare results before and after submitting, it will also not work as both can be the same.

So, for now, I have used static wait which is not a good approach, looking for something which could help.

Thanks,
Sarthak

------------------------------
Sarthak Dhasmana
------------------------------

Have you tried using a conditional Wait Stage with Parent Document Loaded? I know there's no Document Loaded in Chrome/Edge automation. It does blow my mind that Blue Prism did not make browser automation be consistent with actions and such available in IE automation, such as the lack of Match Reverse and Document Loaded options. Anyway, The goal of Parent Document Loaded is to wait for two things: (1) the target element to exist and (2) the page to finish loading. The ideal situation to handle what you're going for, I think, is to use a Navigate Stage or w/e to trigger the page reload then use a very small static/arbitrary wait stage afterward or even put the wait directly in the Navigate Stage (let's say 2 seconds to be safe) and then immediately after that have another wait stage that is conditional and uses Parent Document Loaded. Even though this is waiting for the same page, it "ideally" should wait for the page to finish loading because that's part of the functionality of Parent Document Loaded.

There's something important here I've found that can be very important. The element you choose to use in the Wait stage can affect whether the wait stage truly waits for the full page to load or not. What I've found to work well (and this is kind of standard in blue prism anyway) is to choose an element that should take the longest to load and then use Parent Document Loaded on that element. The reason this is important is especially in web pages with iframes and other similar constructs where waiting for an element in the wrong container could cause Blue Prism to not realize the page is technically still loading.

And then in the worst case if the above doesn't work, you may just want to put in a static wait like you said but use a loop so it can check periodically for results or whatever it's looking for and have a max loop limit of some kind to govern how many times it checks. It's not perfect, but it works ok for me.

------------------------------
Dave Morris
Cano Ai
Atlanta, GA
------------------------------

Dave Morris, 3Ci at Southern Company

Thanks, Dave, I will try this, but as per my previous experience doing this, Parent Document loaded was not waiting for page load.
I will deep dive into this and will update here If I found anything.

Thanks,
Sarthak

------------------------------
Sarthak Dhasmana
------------------------------