How to handle errors when loading website

Hello everyone, I want to know how to handle errors like: “This site can’t be reached”, “Aw, snap something wen wrong…”, etc.
I have been trying with activity Element exist, but for each type of error i have to use another Element exist activity, so I want to know better solution for handling errors when loading website.

Hi @Dawid_Nguyen ,

Here, we need to understand whether you really need to get these different error messages when loading the website or if you just want to understand if the Page has loaded properly or not.

If the Page has Loaded properly, there will be certain UI Elements in the Screen which you can consider as the proof of Page Loading Success. If these elements are not loaded then you can consider it as Page Loading Failure, you might not need to capture all errors that arises.

For this you can use Element Exists Activity, which should hold good.

A better way to do it is to think of it as “what happens if the page loads successfully” and check for that. Otherwise, an error must have occurred.

Hello @Dawid_Nguyen

If the website gets load properly you will be doing some action on the website.
So directly you can check for some element , if it’s false then you can thrown and exception.
So the Process should be in a Try catch block. if an exception is caught, then if you need to retry you can do that.

So in this kind of scenarios better to go with Reframework if your system can throw exceptions during execution.


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.