Question

How to determine if a webpage has loaded completely (Chrome - A360) ?

  • 21 December 2022
  • 9 replies
  • 2520 views

Badge +1

Hi All,

I have built a bot but I get an error saying the webpage took too long to load even after I see the webpage is completely loaded.

So I need a wait condition to check and proceed only if the webpage has loaded completely in all forms.

Does any one know how to check this in AAE? 
If you have any method via JavaScript Please feel free to share the script and its usage.

 

Thanks and Regards.


9 replies

Userlevel 3
Badge +6

Dear @Mohammed Burhaan,

 

  1. Use the "Wait" action to specify a time period for the bot to wait before proceeding. This can be useful if the webpage takes a consistent amount of time to load.

  2. Use the "Wait for Object" action to wait for a specific element on the webpage to be loaded before proceeding. This can be useful if you know that a specific element takes longer to load than other elements on the page.

  3. Use the "Execute JavaScript" action to execute a JavaScript script that checks if the webpage has finished loading

  4. Use the "Wait for Window" action to wait for a specific window or tab to be loaded before proceeding. This can be useful if you are interacting with multiple windows or tabs in your bot.

 

Regards,

Userlevel 7
Badge +13

Hi @Mohammed Burhaan ,

 

The best option would be to use dynamic dealy inside a Loop-While action by specifying loop until a certain object doesn't exist on the page.

 

You can add a condition to exit the loop after a certain waiting period reached.

Badge +1

Hi Padmakumar and Zaibi,

 

The problem I am facing is visually the webpage is completely loaded I can see it with my eyes. But from the server side I feel it has to be loaded completely.

 

I need a mechanism to find this out whether from server side it has loaded 100% or not.

 

Userlevel 1
Badge +5

Try to Use the "Wait for Object" action to wait for a specific element on the webpage to be loaded before proceeding. This can be useful if you know that a specific element takes longer to load than other elements on the page.

Userlevel 7
Badge +13

Hi Padmakumar and Zaibi,

 

The problem I am facing is visually the webpage is completely loaded I can see it with my eyes. But from the server side I feel it has to be loaded completely.

 

I need a mechanism to find this out whether from server side it has loaded 100% or not.

 

 

On what basis are you assuming that the page is not loaded completely from the Server end?

Is it through by checking the presence of any Object or Elements within the Web page?

 

If so, you can still use the approach which I have mentioned above.

Badge +1

Hi Padmakumar and Zaibi,

 

The problem I am facing is visually the webpage is completely loaded I can see it with my eyes. But from the server side I feel it has to be loaded completely.

 

I need a mechanism to find this out whether from server side it has loaded 100% or not.

 

 

On what basis are you assuming that the page is not loaded completely from the Server end?

Is it through by checking the presence of any Object or Elements within the Web page?

 

If so, you can still use the approach which I have mentioned above.

It is because the bot fails to capture an action and says “Web page took too long to load”

Userlevel 3
Badge +6

Dear @Mohammed Burhaan,

 

If you are seeing the error message "Web page took too long to load", it likely means that the webpage you are trying to interact with is taking longer to load than the time limit you have specified in the "Wait for Web Page to Load" command. This can be caused by a number of factors, such as:

  1. Slow internet connection or network issues
  2. High server load or server-side issues
  3. Complex or resource-intensive webpages

To fix this issue, you may need to adjust the time limit in the "Wait for Web Page to Load" command to give the webpage more time to load. Alternatively, you can try using the "Wait for Element" command to wait for a specific element on the page to be present before moving on to the next action. This can be more reliable than waiting for the entire page to load, as it allows you to specify a specific element that you know will be present when the page is fully loaded.

 

Regards,

Userlevel 7
Badge +13

Hi Padmakumar and Zaibi,

 

The problem I am facing is visually the webpage is completely loaded I can see it with my eyes. But from the server side I feel it has to be loaded completely.

 

I need a mechanism to find this out whether from server side it has loaded 100% or not.

 

 

On what basis are you assuming that the page is not loaded completely from the Server end?

Is it through by checking the presence of any Object or Elements within the Web page?

 

If so, you can still use the approach which I have mentioned above.

It is because the bot fails to capture an action and says “Web page took too long to load”

 

Try with the basic steps first.

1) Clear browser cache/cookies and validate the issue

2) Use the latest recorder package

3) Lengthening the Timeout (15 sec by default) to 30 or 45 seconds

 

If the above doesn’t work then, you may employ a retry mechanism by nesting a Try-Catch within a Loop(for n times) and a Break Action towards the end in the Try-Catch block.

 

This way, the retry only activates if the Actions encounters any error.

 

The Break activates when all the Actions are executed and prevents the bot from retrying if the process doesn't fail at any point.

 

 

In JavaScript point of view, following syntax is used to implement delay any block of code by specific time.

setTimeout(callBack_method, timeInMilliSeconds);

The below example on which the setTimeout() method is used to delay the web page loading time by 5 seconds.

Userlevel 5
Badge +14

@Mohammed Burhaan : Try to open webpage in developer mode, capture calls in networktab.. identify what was the last call and response that triggered in that page. USE the same api call and response to check if all data loaded and displayed on the screen. I guess this is optimal way to identify the data is loaded rather than wait or identify particular object in the screen...

Reply