Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98775

Need help in Javascript + Selenium Automation for Gmail

$
0
0

I need to open the latest email in gmail and get an authentication code from the email. Using Javascript and Selenium. I need some help in opening the lates email and getting the auth code part, already did the login part. Please find sample login attached.

module.exports = async function(context, commands) {
  await commands.navigate(
    'https://accounts.google.com/signin'
  );

  try {
    await commands.addText.byId('smaplemail', 'identifierId');
    await commands.click.byClassNameAndWait('RveJvd snByac');
    await commands.wait.byTime(10000);
    await commands.addText.byXpath(
      'pass',
      '//input[@name="password"]'
    );
    await commands.click.byClassNameAndWait('CwaK9');
    await commands.wait.byTime(5000);
  } catch (e) {
    throw e;
  }
};

How should I open the latest email, and get an auth code by regex from that email?

Thanks in Advance


Viewing all articles
Browse latest Browse all 98775

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>