I need to write a smart RanoreXPath that will find the div of text Flight 2242 and will hit <div class="x-list-disclosure "/> of the following code.
Current solution:
.//div[@innertext='Flight 2242']/../../../../div[2]
But, I need a smarter one that does not need to travel by hard coded parents like this /../../../../
Something, theoretically,
.//div[@innertext='Flight 2242']/((../)*div[@class~'x-list-disclosure'])*
Or, I need to write a user code function that can travel to parent and look for the right div child? Thanks for any comments.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<div id="ext-component-6" class="x-list-container">
<div class="x-list-item" id="ext-element-168">
<div class="x-list-item-label">
<div class="list-item-main">
<div class="top gs-top">
<div class="left clr-white">[b]Flight 2242[/b]</div>
<div class="right clr-white gs-top-right-due">
Time remaining is
<span class="em-time">6:30</span>
</div>
</div>
<div class="bottom">
<div class="cell2 left">
<table class="tbl">
<tbody>
<tr>
<td class="bdr-bottom">737-200 - 245</td>
</tr>
<tr>
<td class="bdr-bottom">19 Planned Items (SERVICE)</td>
</tr>
<tr>
<td>4 Open Faults / 1 MEL Deferrals</td>
</tr>
</tbody>
</table>
</div>
<div class="cell2 center">
<table class="tbl">
<tbody>
<tr>
<td>
</td>
<td class="cell3 fnt-small center">Arrival</td>
<td class="cell3 fnt-small center">Departure</td>
</tr>
<tr>
<td class="cell3 fnt-small right">Time</td>
<td class="cell3 center bdr-bottom">13:15</td>
<td class="cell3 center bdr-bottom bdr-left">19:45</td>
</tr>
<tr>
<td class="cell3 fnt-small right">Gate</td>
<td class="cell3 center">34</td>
<td class="cell3 center bdr-left">15</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
[b]<div class="x-list-disclosure "/>[/b]
</div>