Hi i have this HTML code:
<tr class="odd events" style="">
<tr>
<a title="Expand to see Actions" class="toggleEvent" name="actions_for_host_1" href="#"></a>
<td id="7" colspan="6">
<div>
<ul>
<li>Low Alarm at 2010/06/25 07:09 ( <span title="2010/06/25 14:09 (UTC)" class="time_helper">Pacific</span> )</li>
</ul>
<div></div>
</div>
</td>
</tr>
How can I retrieve the <li> value using xpath and selenium ruby, so I get back "Low Alarm at 2010/06/25 07:09 Pacific"?
I don’t know what the time and date will be but I know the <li> tag will always start with Low Alarm
thanks
sorry i couldn’t phrase the question better.
You need to use the
getTextcommand to retrieve the text using a suitable locator. There are a few possible locators that you could use, some suggestions are listed below:XPath:
locate the li based on the child span with the class time_helper
locate the li based on the text starting with ‘Low Alarm’
locate the li based on the text containing ‘Low Alarm’
CSS:
locate the li based on the text starting with ‘Low Alarm’
locate the li based on the text containing ‘Low Alarm’