4

Every time I verify mail through Gmail, it shows a page "Verify It's Your page". How can I be able to enter OTP code for verification as each time I run the test cases I get new OTP code?

I want to click the activation link to activate my login account through the tellurium, but when the process goes from Gmail > sign-in and then a new page opens Verify Its You, and now for me to get verified, I have to enter OTP code.

Is it possible to achieve this scenario using Selenium?

  • Can you share more specific details? and what you have tried? – Helping Hands Dec 1 '15 at 6:30
  • I want to click in the activation link to activate my login account through the tellurium, but when process goes from Gmail > sign in and thena new page open Verify Its You, and now how am i verified, i have to enter OTP to varify. – amit pachaury Dec 1 '15 at 6:49
0

I might have a solution. But I'm not sure if this is the correct approach. You can download the backup codes from google for your account and then select the "use backup code" for signing into the account.

The backup codes can be stored in an excel and then can be entered sequentially. Of course, the backup code is valid only once and you'll have to download a new set once you have exhausted that. Hope it helps!

0

aerogear-otp-java - Java One Time Password API provides insights about how an otp is generated. It worked for okta verification, you may try this with Tellurium and see if it works out.

Here is the snippet that worked perfectly fine for me:

org.jboss.aerogear.security.otp.api.Clock otpClock = new Clock(30);
org.jboss.aerogear.security.otp.Totp totp = new Totp(secretKey, otpClock);
  • Link only answers are usually removed from this forum. you might want to write a proper solution and use the link as reference – IAmMilinPatel Nov 23 '16 at 15:12
  • @TESTasy added the code snippet that worked fine for me. – Kenil Fadia Nov 24 '16 at 8:54
0

There is not a simply and "clear" solution, because it's not a simply case, I guess. I see two ways how to manage it:

  • Connect Android device to PC and by using ADB gets OTP from SMS (on stackoverflow you can find a ready solutions)
  • Download an application which forwarders SMS automatically on the particular email address

The second solution seems easier to implement but it's already your decision.

0
        String userProfile= "C:\\Users\\user\\AppData\\Local\\Google\\Chrome\\User Data\\";
        System.setProperty("webdriver.chrome.driver","C:\\Users\\user\\Desktop\\chromedriver.exe");

        ChromeOptions options = new ChromeOptions();
        options.addArguments("--user-data-dir="+userProfile);
        options.addArguments("--profile-directory=Default");
        options.addArguments("--start-maximized");

        WebDriver driver = new ChromeDriver(options);
        driver.get("https://mail.google.com/mail/u/0/#inbox");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.