In my web application I have a table containing a number of rows of information. Most of these rows will be formatted normally but one will will shown in red text as it represents the currently active option in the list. You can see this in the cut down version of the table code below:
Code: Select all
<table class="Gridview">
<tbody>
<tr class="sortedHdr"><th scope="col">Id</th><th scope="col">Text</th></tr>
<tr style="color: red;" class="odd"><td>1</td><td>LIVE</td></tr>
<tr class="odd"><td>2</td><td>TEST</td></tr>
<tr class="odd"><td>3</td><td>OFFLINE</td></tr>
</tbody>
</table>
Now, what I need to do is create some code that can look at this and determine which option is currently selected - so in the example above you can see that LIVE is currently red. Previously when interrogating table I have been using code such as:
Code: Select all
TableTag myTable = myrepo.Website.Table;
IList<Ranorex.TrTag> myRows = myTable.FindDescendants<Ranorex.TrTag>();
This has always been my go to code and worked well. Unfortunately, the identifying piece of code in the table is contained
within the TR tag and my go to code doesn't see it. I'm trying to work out if there's a way to see this style information contained within the TR tag using something similar but haven't been able to work out how yet.
Is there something obvious I'm missing or is there a better way to get the style information out whilst maintaining a reference to which table row and option I'm on?
At the end of the day if I can't use this and I need a new piece of code then so be it!