Hi, I have used 2 Try Catch activity in the same sequence,
Now in the first Try Catch I am opening the browser and Login to the Portal. In the second Try Catch I am checking the Result.
I have ran the bot in a normal mode only.
The browser page not opening and it’s moving to the Catch block of First Try Catch,
when it executing the 2nd Try Catch it thrown the exception in the Try Block and stop the bot there only if there is exception Catch should executed.
Bro, could you please how to identify which type of exception we have to use.
But it’s a web page related exception, so do we need to use the System.Exception here ?
**But now it’s working bro, when I set the System.Exception. **
But I want to know so when we have to give the different - 2 exception type. ?
Fine
i hope the second set of sequence in TRY block in second try catch activity will get executed only when the sequence in the first TRY CATCH activity gets executed successfully
…so keep the second set of activites inside the TRY block of FIRST TRY CATCH ACTIVITY Itself
that is dont create second TRY CATCH block and put that set of sequence
System.Exception will catch any type of exception. If you know what type of exception it will give then you can use corresponding exception type else use System Exception.
Hi Palani, I have to handle the many exception, If I put everything one Try Catch, then it will show me the one error, how do I know where is the error, like the error is opening browser, or login to the credentials or checking the result. Like this.
Bro in second Try Catch I am checking the result, so I the first Try Catch login successfully, then it will not moving into the Catch block right??
So bot will not check the result here, bcz in second Try Catch I have used the check result activity. So confused bro.
And one more, In the first Try Catch block the portal is taking time to reload, but bot execute the Catch block. bcz it’s not waiting for the portal to load fully and login. So how to handle this exeption also. I want my bot wait till the page open and login, If the site is not working then I want to execute the Catch block. @Palaniyappan@lakshman
ah i have changed in the previous comment
–like in the first TRY CATCH activity with CATCH block include the same sequence of activities that we have in the TRY block so that it will perform again the same set of sequence.
and in the FINAL block include the second TRY CATCH activity with the sequence you have
now, as the FINAL block will get executed always
and for this
use ELEMENT EXISTS ACTIVITY and get the output with a variable of type boolean
and use a if condition like this booleanvariable = True
if true it will got to THEN part or to the ELSE part where include a THROW activity with a exception statement like this new BusinessException(“your exception message”)
so that it will take us to CATCH block
I understand I have to use the Second Try Catch inside the First Try Catch Final Block. Now
Element Exist Activity I have to use in Try Block Of Second Try Catch Right??
If yes then It will give me the True/False result. So If condition where I have to use. you mean in Catch Block of Second Try Catch Activity??
And second question also like If I am checking the opening portal and login in First Try Catch activity. And same sequence I have put in Try and Catch block. Assuming in Catch my login got successfully then it will executed the Final that I got. and it’s fine.
Now suppose side is not login in Try block and when it try for second time in Catch block again it failed to login. So this error how do I show??? Hope you understand bro.
no no
the element exists has to be used in TRY block in first TRY CATCH ACTIVITY and next to that use IF and THROW activity inside the ELSE part so that if any exception occurs it will go to CATCH block where we are now having our set of sequence to be performeed
once after that it will get into FINAL block where we have our SECOND TRY CATCH activity
Okay got it bro. So for this which property of Wait for Ready I have to select and the timeout value also. See bro sometime it’s takes 2 min sometime it open in 5 sec also, So I want to make dynamic only once the element found then it proceed with the second step.