How to search texts in a page using selenium by tags

11 views
Skip to first unread message

robin paul

unread,
Apr 11, 2012, 4:20:04 AM4/11/12
to browserm...@googlegroups.com
Hi frnds
I want to search a string Wireless and Enabled in a web page
html code is as below
<tr>
<th>Wireless AP</th>
<td>Enabled</td>
</tr>
Can it be done using xpath mentioning tags?
i can do it using Assert.assertTrue(selenium.isTextPresent("Wireless AP"));
Assert.assertTrue(selenium.isTextPresent(" Enabled  "));

But there are lof of Enabled texts in the page and i want to search this particular pattern Wireless AP and Enabled

thanks
robin

Patrick Lightbody

unread,
Apr 22, 2012, 10:30:45 PM4/22/12
to browserm...@googlegroups.com
Robin,
You're asking a Selenium question, so I recommend you try the Selenium Users mailing list in the future.

My xpath is a little rusty, but this might work:

//th[text() = 'Wireless AP']/../td[text() = 'Enabled']

Patrick

--
Patrick Lightbody



Reply all
Reply to author
Forward
0 new messages