Skip to main content

In this flow, I’m aimed to do a login process.
1. Error handling, Loop 3 times to retry login if failed to log in in later step,
2. Open the file location
3. Capture element
4. set text
5. condition check 
    If login success:
      proceed to next step
      else 
      it should retry the login step 3 times
6. Catch error
7. Throw error.

Somehow even it failed, message box is popped out but loop login logic didnt work. Could someone spot my errors and suggest ways to resolve. Appreciate,

Hi ​@JiangHang,

 

The Finally block will execute regardless of any errors. So, its usage here won't be required in my suggestion. 

Secondly, you had mentioned that you got a message pop-up of a failure scenario. Did you test the Login part alone? The capture action could be failing at the login stage itself.

 

 


Hi ​@JiangHang,

 

The Finally block will execute regardless of any errors. So, its usage here won't be required in my suggestion. 

Secondly, you had mentioned that you got a message pop-up of a failure scenario. Did you test the Login part alone? The capture action could be failing at the login stage itself.

 

 

yes the message popped up is step 17- message box. The login capture action is work. but not the retry logic, anyways to modify it?


Hi ​@JiangHang,

 

The Finally block will execute regardless of any errors. So, its usage here won't be required in my suggestion. 

Secondly, you had mentioned that you got a message pop-up of a failure scenario. Did you test the Login part alone? The capture action could be failing at the login stage itself.

 

 

yes the message popped up is step 17- message box. The login capture action is work. but not the retry logic, anyways to modify it?

Ok.  But if the login part was working then, you should have received the message pop-up from Line 14 instead of 17. This means your IF statement is not working as expected. You may either check the Window title that you are using in the IF condition, or you may need to change the condition from Window exists to Object exists and pass any reliable object within the window.


Hi ​@JiangHang,

 

The Finally block will execute regardless of any errors. So, its usage here won't be required in my suggestion. 

Secondly, you had mentioned that you got a message pop-up of a failure scenario. Did you test the Login part alone? The capture action could be failing at the login stage itself.

 

 

yes the message popped up is step 17- message box. The login capture action is work. but not the retry logic, anyways to modify it?

Ok.  But if the login part was working then, you should have received the message pop-up from Line 14 instead of 17. This means your IF statement is not working as expected. You may either check the Window title that you are using in the IF condition, or you may need to change the condition from Window exists to Object exists and pass any reliable object within the window.

The message box from step 17 because the login part using wrong credentials to test the logic part. But unfortunately, it is failed to retry login as implement eaarly.


Hi ​@JiangHang,

 

The Finally block will execute regardless of any errors. So, its usage here won't be required in my suggestion. 

Secondly, you had mentioned that you got a message pop-up of a failure scenario. Did you test the Login part alone? The capture action could be failing at the login stage itself.

 

 

yes the message popped up is step 17- message box. The login capture action is work. but not the retry logic, anyways to modify it?

Ok.  But if the login part was working then, you should have received the message pop-up from Line 14 instead of 17. This means your IF statement is not working as expected. You may either check the Window title that you are using in the IF condition, or you may need to change the condition from Window exists to Object exists and pass any reliable object within the window.

The message box from step 17 because the login part using wrong credentials to test the logic part. But unfortunately, it is failed to retry login as implement eaarly.

Ok, you can see where the control is moving after the Login fails through the Debugger in a better way.

 

I suspect your Keystroke action on Line 18 must be failing and Bot is going to the Catch block. Could you please disable that line and try once more?


Hi ​@JiangHang,

 

The Finally block will execute regardless of any errors. So, its usage here won't be required in my suggestion. 

Secondly, you had mentioned that you got a message pop-up of a failure scenario. Did you test the Login part alone? The capture action could be failing at the login stage itself.

 

 

yes the message popped up is step 17- message box. The login capture action is work. but not the retry logic, anyways to modify it?

Ok.  But if the login part was working then, you should have received the message pop-up from Line 14 instead of 17. This means your IF statement is not working as expected. You may either check the Window title that you are using in the IF condition, or you may need to change the condition from Window exists to Object exists and pass any reliable object within the window.

The message box from step 17 because the login part using wrong credentials to test the logic part. But unfortunately, it is failed to retry login as implement eaarly.

Ok, you can see where the control is moving after the Login fails through the Debugger in a better way.

u mean use the debugger to check?


Hi ​@JiangHang,

 

The Finally block will execute regardless of any errors. So, its usage here won't be required in my suggestion. 

Secondly, you had mentioned that you got a message pop-up of a failure scenario. Did you test the Login part alone? The capture action could be failing at the login stage itself.

 

 

yes the message popped up is step 17- message box. The login capture action is work. but not the retry logic, anyways to modify it?

Ok.  But if the login part was working then, you should have received the message pop-up from Line 14 instead of 17. This means your IF statement is not working as expected. You may either check the Window title that you are using in the IF condition, or you may need to change the condition from Window exists to Object exists and pass any reliable object within the window.

The message box from step 17 because the login part using wrong credentials to test the logic part. But unfortunately, it is failed to retry login as implement eaarly.

Ok, you can see where the control is moving after the Login fails through the Debugger in a better way.

u mean use the debugger to check?

Yes.

 

By the way, I have recreated and tested this scenario successfully. The Bot is looping 3 times upon log-in failure here.