Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOW-TO] <Click automatically on the USE A VERIFICATION CODE> #1348

Closed
RicardoJacobsen opened this issue Dec 7, 2022 · 4 comments
Closed
Labels

Comments

@RicardoJacobsen
Copy link

Question

Why in the login process the automation does not work for USE A VERIFICATION CODE? (It should click automatically in use a verification code)

The automation is working fine till reaches this part
image

I have to click manually on the part where it says use a verification code. After I click there the automation continues fine.

How to click on it automatically, so the test flows without human interaction?

Another thing that I would like to know is, how I prevent the web browser to be closed use the same the other test cases?

@RicardoJacobsen
Copy link
Author

@aliyoussefi any suggestion?

@Shakevg
Copy link
Contributor

Shakevg commented Dec 7, 2022

RicardoJacobsen EasyRepro is not supported this for now.
You should implement your own login method.
Did you configure the account by instruction?
Also, you should set added by instruction MFA option as default.

@RicardoJacobsen
Copy link
Author

RicardoJacobsen EasyRepro is not supported this for now. You should implement your own login method. Did you configure the account by instruction? Also, you should set added by instruction MFA option as default.

Yes I did configured as in instruction. I did everything as in instructions to MFA Support. It's working beautifully till this part. Any workaround for this? Maybe alter the login method and add a selenium instruction to find the text " Use a verification code" and click on it?

@RicardoJacobsen
Copy link
Author

I found a simple workaround for that.
I simply created the method below:

 private static bool ClickUseVerificatioCode(IWebDriver driver)
       {
           var x = driver.FindElements(By.XPath("//*[contains(text(), 'Use a verification code')]"));
           x[1].Click();           
           return true;
       }

AND inserted after the method to input the password (WebClient.cs file).

Here is where I called the method;

   EnterPassword(driver, password);
                ThinkTime(2000);  
            }
            
            ClickUseVerificatioCode(driver); // This is where I placed the code

            int attempts = 0;
            bool entered;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants