0

I had a question . When i "inspect" this particular element and take "exact" xpath and copy it to my selenium script and run my script, it fails to identify?

Any idea how to do it? Repeating again, i copied the exact xpath , tried inspecting element. All correct. Still :(

Thanks, S.K

Sitam Jana
  • 3,123
  • 2
  • 21
  • 40
  • Can you provide link to the webpage or complete HTML code snippet of the webpage? – Sitam Jana Mar 22 '14 at 12:35
  • This link might help http://stackoverflow.com/questions/18241029/why-does-my-xpath-query-scraping-html-tables-only-work-in-firebug-but-not-the – Amith Mar 22 '14 at 12:52

1 Answers1

1

If Selenium fails to find an element you know is present, commonly the problem is with synchronization: Selenium tries to access the element too fast, before it appears on the page (and when you try to inspect element even a second later, you can see it, since it was rendered by then). Try to WAIT for the very same element before doing anything else. Examples of the wait can be found here

user1433852
  • 162
  • 1
  • 11