selenium the xpath expression cannot be evaluated
I am facing this exception in IE browser,these xpath works fine in other browser with all windows combination.
Here are the xpath's below provided.
Please provide a solution for this issue which am unable to replicate.
org.openqa.selenium.InvalidSelectorException: The xpath expression '//form[@id='form1']/div/table/tbody/tr/th' cannot be evaluated or does not result in a WebElement
I'm afraid I can't answer this without knowing the web page. I'm assuming you have used xpath/selenium on similar pages that worked just fine?
I've got a couple of ideas for you -
1) My guess is the page just isn't fully loaded when the xpath is executed. Trying injecting a wait - 30 seconds - before the selector.
2) Get selenium IDE, try to write the same test. Don't use the generated code; just look at the xpath and compare it to what you have.
StickyMinds is a TechWell community.
Through conferences, training, consulting, and online resources, TechWell helps you develop and deliver great software every day.