Check error message from Web page exist

Hi. I would like to check for error message on website. I have tried “element exists” and “Image exists” activities but no avail. Please throw in some suggestions! Thank you~~

Capture

@zefang

You can use On Element Appear Activity and indicate that element on the screen. If it is found then use Click Activity inside of this to click “Ok” button.

And also in properties of On Element Appear Activity, set false to RepeatForever.

I want to Message box to appear if that error message appears. @lakshman
Is it the same method?

@zefang

Yes it’s same. Use Message Box Activity inside of On Element Appear Activity. when that error pop up comes then message box will come. It’s better to use after closing that Pop up use Message Box Activity. Otherwise two pop up’s will come at a time.

Capture
I need to click open if the error message doesnt appear. So i am using “IF” activity like so:

@lakshman

@zefang

Sorry. On Element Appear Activity will give output as UiElement but not Boolean value. So we can’t pass output to IF condition.

Am sure here Element Exists Activity will work here. What error are you getting ?

Capture
This error. It will appear on the website if unable to find the file it’s looking for to upload
Capture

@lakshman

@zefang

Yes understood. After entered the filename and you will Click open right ?

If file is not found in that directory then it will show error pop up like file doesn’t exist. You have to put Element Exists Activity after clicking Open button.

Element Exists works now thank you!

1 Like

@lakshman But do you have any idea how to stop the process if the error message appears?

1 Like

@zefang

Yes put the entire process in Try Catch block.

In this case, we are using Element Exists Activity to check whether error Pop up appears or not. If it is exists then it will come to Then part. So, here use Throw Activity and pass some throw message and then directly it will come to Catch block. Here, you use Log Message Activity to display that error message.

@lakshman

what do i do here?

1 Like

new Exception(“File not found”)

1 Like

Okay. then at Catch, is this correct?
Capture

Is “exception.Message” standard?

After the Throw, the process will stop immediately? It will not continue to run right?

@zefang

Yes it’s correct.

Is your entire process in Try block then it will stop immediately and will come to catch block and print that log message and then will stop it.

@lakshman i have other states to run like so:

@zefang

I understood you are using your own template. But it doesn’t have any end state I guess. You put all stated in sequential order and it’s not good. If any error occurs in between then it has to come to End process state and will stop there. Please design the process like that. It will be very helpful.

1 Like

Capture

I have an error like this though

@lakshman

@lakshman

can i use the same throw “file not found” mutliple times but with different file name?

@zefang

Yes you can write any exception message. For example I said “file not found”.