0

been struggling with this for few hours. My XPath is right but I get this error message. I don't seem to get a way forward on this

o such element: Unable to locate element: {"method":"xpath","selector":"//a[@class='btn primary block']"} (Session info: chrome=68.0.3440.106) (Driver info: chromedriver=2.41.578706 (5f725d1b4f0a4acbf5259df887244095596231db),platform=Mac OS X 10.11.6 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html

NydPage nydPage;
GetAQuotePage getAQuotePage;

@FindBy(xpath="//a[@class='btn primary block']")
WebElement GetAQuoteLink;

public NydPage() {
    PageFactory.initElements(driver, this);
}

public GetAQuotePage clickOnGetAQuoteLink() throws Exception{
    Thread.sleep(5000);
    GetAQuoteLink.click();
    return new GetAQuotePage();

}

@BeforeMethod
public void setUp() {
    //driver = new ChromeDriver();
    initialization();
    testUtil = new TestUtil();
    nydPage = new NydPage();
}

@Test(priority=1)
public  void verifyQuotePageLinkTest() throws Exception{
    //testUtil.switchToFrame();
    Thread.sleep(5000);
    getAQuotePage = nydPage.clickOnGetAQuoteLink();

}


@AfterMethod
public void tearDown() {
    driver.quit();
}
Sam.fan
  • 1
  • 2

0 Answers0