Skip to main content
2 of 2
Commonmark migration

First of all, When I opened the link (http://gmail.com) I found this page.

Google Home Page

Before performing any actions you need to click SIGN IN button.

Element :

LinkText = Sign In

OR

LinkText = SIGN IN

OR

css = a[class='gmail-nav__nav-link gmail-nav__nav-link__sign-in']

OR

xpath = //a[@class='gmail-nav__nav-link gmail-nav__nav-link__sign-in']


Code should be like this from line num 38 :

 wd.get(url);
 wd.findElement(By.xpath("//a[@class='gmail-nav__nav-link gmail-nav__nav-link__sign-in']")).click();
 Thread.sleep(2000); // remove this after your code get run properly
 WebElement loginName = wd.findElement(By.name("identifier"));

Sign In Page

After clicking on SIGN IN, browser will open this page and you can run your remain code.

Sagar007
  • 1.3k
  • 3
  • 9
  • 24