How to handle the exception with a network issue?

uiautomation
activities
studio

#1

I need to use gmail, if network issues happen, i need to handle that exception in my browser. I don’t know how to use exception handling clearly


#2

Hello @Spark_robot,

Can you give some more detail? what kind of a issue are we dealing with?


#3

@Rishabh_Lakhera
Hi, sorry is am not facing any issue, I need to create exception handling with network issue.


#4

So you mean to say,
if for some reason you cant connect to the web while the robot works on a web application you want to perform some actions?


#5

ExceptionHandling.xaml (8.8 KB)
Hi! Here is an example
Just add the fields in get imap message


#6

Yes, exactly! Thanks for your understanding my query.


#7

I will try your workflow thanks for that.


#8

In that case lets say you have a workflow where you want to open www.google.com and type into the search bar some value. But while the browser is opening the internet goes down.
What will happen is, you’ll get a SelectorNotFoundException for the typeInto.

So to avoid this, i’d place the type into into a try catch block and set a flag variable to “false” in the try block and to “true” in the catch block and a refresh browser after a delay, and put this whole try block inside a “while”
where the condition will be like flag=true

so what will happen is, when the internet goes down, an exception will be generated,hence the control will go to the catch block where flag will become “true” and we’ll refresh, the while condition will be true and this process will go on!

Although, if while refreshing you get network connection, the page will be loaded and there will be no exception! The value will be typed into, flag will become “false”, and while will be exited!

@Spark_robot,
Let me know if I’m clear :slight_smile:

While condition : internetFlag=true


#9

@Rishabh_Lakhera
Thank you so much, you cleared me more than what I expected.


#10

I’m glad you understood that @Spark_robot !
Could you please mark it as a solution so that others can take help from it :slight_smile:

Thanks alot!


#11

@Rishabh_Lakhera
Sure