This is a migrated thread and some comments may be shown as answers.

Control issue.

1 Answer 54 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SD
Top achievements
Rank 1
SD asked on 18 Aug 2010, 02:14 AM
Hi, 

I've got the following html control:
<td class="dr-dscr-button rich-datascr-button" onclick="Event.fire(this, 'rich:datascroller:onscroll', {'page': 'fastforward'});">»</td>

On some occasions, I've got 2 of those 'guys' (">>") on the screen but usually I need to click the one that resides on the button of the page. 
For some reason the following was not helpful and returns count of 0 as if the control was not found.  

var forward = (from b in Manager.ActiveBrowser.Find.AllControls<HtmlControl>() where b.ToString().Contains("»") select b);
                 
Console.WriteLine(forward.Count().ToString());
This works in case there's one control on the screen but it's easier to have all controls in a list to be managed...
HtmlControl forward = Manager.ActiveBrowser.Find.ByXPath<HtmlControl>("//tr/td[text()=\"»\"]");

Any ideas ?

Ta.

1 Answer, 1 is accepted

Sort by
0
SD
Top achievements
Rank 1
answered on 18 Aug 2010, 02:36 AM
Looks like the following solves it....Using xpath though...
var forwards = Find.AllByXPath<HtmlControl>("//tr/td[text()=\"»\"]");
forwards.Last().Click();//Either use First or any other location...
Ta.
Tags
General Discussions
Asked by
SD
Top achievements
Rank 1
Answers by
SD
Top achievements
Rank 1
Share this question
or