0

I am unable to locate the sign in element on HTTPS.

This code

   WebElement signin =driver.findElement(By.xpath(".//*[@id='mc_mainWrapper']/header/div[1]/div/div[2]/div[2]/div[4]/a/strong"));

causes this error

java.lang.NullPointerException
BSMP
  • 4,596
  • 8
  • 33
  • 44
Ayush
  • 1
  • 3

1 Answers1

0

I have tried this and link text is working.

public static void main(String[] args) 
{
    System.setProperty("webdriver.chrome.driver", "/home/santhoshkumar/Softwares/Selenium/drivers/chromedriver2.29");
    WebDriver driver = new ChromeDriver();
    driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
    driver.get("http://www.moneycontrol.com");
    driver.findElement(By.linkText("Sign in")).click();
}

The same xpath that you have written also works well for me.

santhosh kumar
  • 1,981
  • 1
  • 9
  • 28