Question

Error Handling / Error Codes for Website Load Issues

  • 19 October 2022
  • 3 replies
  • 156 views

Hello-

 

I am building a bot that will interact with a webpage and I would like to put some error handling into the automation. Essentially I want to:

 

1. Try to open the webpage. If it is succesful move to next step

2. Try to open the webpage if not successful try to load the webpage again 2x..... Not sure what error code would occur in this instance? Can someone provide the error code.

 

Also, if there are any other webpage related error codes that I should take into account please give me the number so I can identify this....

 

So the logic would be if X Internet/Webpage Issue Error Do Y

 

or if there are multiple Internet/Webpage Errors then if X, Y or Z Error do this....etc.

 

I am unsure of the error codes or other ways I could Identify these type of issues. Thank you for your help in advance.


3 replies

Badge +6

There are a number of ways to skin this proverbial cat. Here is one way:

 

  • Launch the site using the Browser>>Open action
  • Find an element (input, button, etc.) on the page that would signify the site is fully loaded
  • Use the Wait>>Wait for condition action, and select the Recorder Object Exists condition
  • Set the timeout on this action for whatever you would like (30-60 seconds normally)

 

forumPic 

As for trying multiple times, I would personally put the site Open/Capture steps into a try/catch block, and then place that into a loop that writes out to my log file. Something like this, as an example:

 

forumPic2

Userlevel 4
Badge +7

Hi @Matthew Mickle​ ,

 

Here is a video walkthrough of this year's bot games which uses the error handler.

You can start watching it from the 48.38 mark.

 

Kind Regards,

Ashwin A.K

@Jeremiah Logan​  Thank you so much for taking the time to respond. I really appreciate your insight into this issue. I believe this will work!

 

@Ashwin A.K​ This is very helpful. Believe it or not I have been going through the bot games exercises and I was actually going to do this one next. Very fitting....LOL

 

Thanks to both of you!

Reply