yangyq10
(IvanY)
April 18, 2024, 7:44am
1
Dear Experts
I have a request as below:
Open browser and relative website - Done
Key in IT Code/Password/Verification Code(use OCR to indentify) - Done
If the Verification Code input is incorrect, then the webpage will show [Capcha error] after you click [Sign in]
I need the robot to rethrow this process until correct Verification Code is input and [Sign in] successfully
I use [Try Catch] for it but the process never rethrow. It just directly end the process
May I know what I need to do to make it happen?
PS: I try several exception types in [Cathces] but none of them succeed
Thanks for your kind help in advance
Ivan
@yangyq10 Put your try catch inside a while loop in the the loop have a boolean condition sign in successful if it is you break the loop if it is not you retry again
yangyq10
(IvanY)
April 18, 2024, 7:52am
3
May I know how to use variable to show [Sign in] successfully?
Ajay_Mishra
(Ajay Mahendra Mishra)
April 18, 2024, 7:53am
4
Hey @yangyq10
After Click Activity of Sign In button,
Add Element Exist activity and indicate Error pop-up, output of this activity will be boolean, pass that in If Activity.
If Activity → True → then Throw Activity property will be New Exception("Login Error")
False → Else → Log Message → “Logged In Sucessfully”
Remaining activities are correct!
Regards,
Ajay Mishra
@yangyq10
Something like this
this will continue looping until you sign in successfully. You would need to get text of the captcha error element.
Alternatively, You could also indicate an element on the home page and reverse the conditions
yangyq10
(IvanY)
April 18, 2024, 8:58am
6
Thank you for the detail guidance.
I debug just now. If error popup, it can now retry
But even though it successfully sign in, it still run into the new loop.
May I know if its anything wrong about the condition?
Ivan
@yangyq10
Add this condition as well and let me know
this is within the loop.
Also if you still face some challenge enable this property in your get text property
yangyq10
(IvanY)
April 18, 2024, 11:11am
8
Thank you for staying with me. It finally works!!
Best regards
yangyq10
(IvanY)
April 18, 2024, 11:12am
9
Thank you for your advise. I will take a try on it
system
(system)
Closed
April 21, 2024, 11:12am
10
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.