Want to Retry putting the code 2nd time Using If condition Login - for efficiency

How can I make the process more Efficient ??

I am trying to login into a carrier portal using Login. the process works fine.

my process looks like: Homepage appears - > Click Login → enter Username password

Get credentials for Mircrosoft email → Get Email → Store that OTP into variable-> that variable enters the code in the secure login screen → I

f code valid → Logins Inside → If not valid → clicks on get a new code.

for the new code again the email is fetched and entered into secure login screen for verification
mostly it helps me login in second time , but sometimes 2nd code fails and My code throws a Exception after the second try.

how can i make the If condition go and run for the thrid time as well ??

I have already put an booelan variable so that it doesnot run into infinite loop !!

Hello,

for this scenario I think the Retry Scope activity is the best suited.
You can use properties of activity to set maximum number of retries and the time to wait between each.
Inside activity at the end for instance you wan use a check app state to get boolean if loggin succedded, and in the condition part use Check true activity with your boolean

Hope this helps

Hi @Matt67

My setup of the If activity is like ,
I have setup a Boolean variable callforretry = false and
when the Check app state activivty checks → that my Login is not done then this if condition is run

and when if condition is run , i have set the boolean to be true so that it doesnot run in aloop.

can you please tell me how should i use retry scope and how exactly i can pass the if condition inside that retry scope ? so that it runs only untill we are not logged in ??

because my boolean variable call for retry already get sets to true after one run.

how can i utilise Check True ? with Retry scope and use my If condition ?

It will be very helpful thanks in advance

image

Hi @Matt67

My setup of the If activity is like ,
I have setup a Boolean variable callforretry = false and
when the Check app state activivty checks → that my Login is not done then this if condition is run

and when if condition is run , i have set the boolean to be true so that it doesnot run in aloop.

can you please tell me how should i use retry scope and how exactly i can pass the if condition inside that retry scope ? so that it runs only untill we are not logged in ??

because my boolean variable call for retry already get sets to true after one run.

how can i utilise Check True ? with Retry scope and use my If condition ?

It will be very helpful thanks in advance

image

The Check true activity should be placed in the condition part of retry scope. if condition is not met it will retry the Action part. In Action you should place what you want to do, the login part. In action too, put check app state with result variable.
The Checktrue is used to be able to put a boolean variable as a condition to exit / retry in retry scope. ( Check false also exists depending of what you check, user loggin in successfull or not )

Is it more understandable for you ?

Hi @Matt67

i understand the usage of check true activivty , i have by mistake put inside action , to take a screenshot

however , my question still remains

" my boolean variable call for retry already get sets to true after one run. "
and when if condition is run , i have set the boolean to be true so that it doesnot run in aloop.

how can i move this logic within retry scope so that it tries for a second time as well but shoudlnot go in a loop

does it make sense ?? or should i give more clearity ?

thanks for the help

Hi,

You can try using flowchart.
If possible, please share your xaml file. I will update the same.

Thanks

Hi @Jayesh_678 Jayesh thanks for your help , but i am supposed to use a sequence

however, i want to modifty this retry scope to run only untill my login is not successfull

1 Like

hi @Matt67

Hello,

for what I understand in your screenshot
First, you can remove the if not in_CallForRetry because retry scope have this usage to retry itselfs if condition is not met. Also you can write ErrorMessage inside CheckTrue activity and if after retries condition is still not met it will throw error with your error message.

Then the only thing you have to do in Action sequence is the login. It can go for a second try by itself modifying number of retries property of retry scope.

If you want more help maybe you can share project

Hope that helps

1 Like

Hi @matt

the activivty i am configuring is inside TwoFactorXaml
Main.xaml (39.1 KB)
TwoFactor.xaml (32.7 KB)

hi @Matt67

i need more help , thanks appreciate it