Selenium is not recognizing xpath



  • When I attempt to search for the following element by XPath, Selenium does not find the the element. Not sure what I'm missing here.

    driver.FindElement(By.XPath("//input[@type='text']")).SendKeys("Test");
    


  • May be because there are many elements on the page with same xpath. check if you have more than one input type text element present on the screen.

    install plugin firepath on mozilla then paste your xpath over there it will highlight the elements ,if it highlights more than one element then you need to change the xpath



Suggested Topics

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