Selenium webdriver - Unable to locate element,xpath,error



  • I am testing localization. I am running the same URL with other countries in my data provider.

    The HTML I am looking for is:

    <a class="learn-more linkable" data-url="/speakers/minijambox">En savoir plus</a>
    

    Here is my code:

    String storeXpath2="//a[contains(@fbio driver.findElement(By.xpath(storeXpath2)).click();
    System.out.println("Learn more link of Mini");
    

    url I am trying to execute: /speakers/minijambox

    Error I am getting unable to find xpath, element or method.



  • The HTML tag you are trying to match has a class attribute and a data-url attribute but not an href attribute. Either you mistyped the HTML tag in your question or you need to change the definition of storeXpath2 to something like this:

    String storeXpath2="//a[contains(@fbio                                   ^^^^^^^^ 
    


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2