Hi!
The xpath to the span with the text is //span[Text()=’YES’]
The xpath to the a is: div/h2/a
Now put it together: //div[span[Text()=’YES]/h2/a
That basically it translates to: Find all the divs with the text = to YES. Then finds the ‘h2’ tag and then the ‘a’ tag
You say the list can grow. So if there are more links with Yes I would handle that in code instead of using xpath. I never use Text() in my xpaths. I always use the IWebElement Text property instead. I find it much more reliable. But that’s just meJ
A tip for experimenting with xpath is to use the firebug addon firepath. (it is not updated anymore but still a excellent tool to use for xpath etc) I use it daily in my work.
Let me know if you are stuck.
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at http://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/groups/opt_out.