0

I am doing an automation with Selenium Webdriver using Java. I need to click the class name inside the span tag. Example

For this i used xpath to select class="selcteME" and used click(). This works fine if I put break point in debug mode but when I run the script without break point in debug mode object is not selected.

Please share if you have solution or suggest me how can I get the class name inside the span tag

() without xpath

some_other_guy
  • 3,364
  • 4
  • 37
  • 55
  • Paste a snippet of the html you're having issues – raven Aug 12 '12 at 01:34
  • 1
    I think the problem is that the element is not loaded yet, you should wait for it. check this out http://stackoverflow.com/questions/11862866/how-can-i-overcome-element-id-exception-in-selenium/11863045#11863045 – Herokiller Aug 13 '12 at 05:25
  • possible duplicate of [Selenium not finding element](http://stackoverflow.com/questions/17853450/selenium-not-finding-element) – Petr Janeček Apr 03 '14 at 09:31

1 Answers1

-1

Have you tried by CSS Selector?

I suggest use some IDE to generate basic test and then use your logic.

some_other_guy
  • 3,364
  • 4
  • 37
  • 55
  • 1
    While using CSS selectors and other location techniques is usually preferable to XPath, OP specifically says that the XPath expression works when debugging. This hints to a timing problem, not an XPath-problem. – Petr Janeček Apr 03 '14 at 09:29