org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression

Stack Overflow | mskumar | 1 month ago
tip
Your exception is missing from the Samebug knowledge base.
Here are the best solutions we found on the Internet.
Click on the to mark the helpful solution and get rewards for you help.
  1. 0

    selenium2 https

    GitHub | 12 months ago | lukeis
    driver.version: RemoteWebDriver
  2. 0

    selecting links from particular area

    Google Groups | 5 years ago | Selenium Tester
    driver.version: RemoteWebDriver
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

  4. 0

    getAttribute("style") is Returning Blank Value

    Google Groups | 5 years ago | prem kumar
    driver.version: RemoteWebDriver
  5. 0

    xpath.getText()

    Google Groups | 5 years ago | Binnu
    driver.version: RemoteWebDriver

    2 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.openqa.selenium.InvalidSelectorException

      invalid selector: Unable to locate an element with the xpath expression

      at sun.reflect.NativeConstructorAccessorImpl.newInstance0()
    2. Java RT
      Constructor.newInstance
      1. sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2. sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
      3. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
      4. java.lang.reflect.Constructor.newInstance(Unknown Source)
      4 frames
    3. Selenium
      RemoteWebDriver.findElementByXPath
      1. org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
      2. org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
      3. org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:635)
      4. org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:368)
      5. org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:473)
      5 frames
    4. selenium-api
      By$ByXPath.findElement
      1. org.openqa.selenium.By$ByXPath.findElement(By.java:361)
      1 frame
    5. Selenium
      RemoteWebDriver.findElement
      1. org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:360)
      1 frame
    6. Testing
      TestPage.flights
      1. Testing.TestPage.flights(TestPage.java:30)
      1 frame
    7. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      4. java.lang.reflect.Method.invoke(Unknown Source)
      4 frames
    8. TestNG
      RemoteTestNG.main
      1. org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
      2. org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
      3. org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
      4. org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
      5. org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
      6. org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
      7. org.testng.TestRunner.privateRun(TestRunner.java:756)
      8. org.testng.TestRunner.run(TestRunner.java:610)
      9. org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
      10. org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
      11. org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
      12. org.testng.SuiteRunner.run(SuiteRunner.java:289)
      13. org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      14. org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
      15. org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
      16. org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
      17. org.testng.TestNG.runSuites(TestNG.java:1133)
      18. org.testng.TestNG.run(TestNG.java:1104)
      19. org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
      20. org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
      21. org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
      21 frames