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

Number of occurrences etc.

2 Answers 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
SD
Top achievements
Rank 1
SD asked on 17 Aug 2010, 04:41 AM
Hi Guys, 

I've been using some thing like this in the past to retrieve the number of times a certain image appears on the screen in a given time:
getXpathCount("//img[@src=\"/images/someImage.gif\"]");

Does Webaii offer a similar mechanism (Not necessarily using xpath...) ?

Ta. 

2 Answers, 1 is accepted

Sort by
0
Konstantin Petkov
Telerik team
answered on 17 Aug 2010, 06:41 AM
Hello SD,

Using LINQ queries with lambda expressions gives a lot of power and flexibility for the framework. Please give those a go and feel free to share your solution in the forums, thank you!

Greetings,
Konstantin Petkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
SD
Top achievements
Rank 1
answered on 17 Aug 2010, 11:56 PM
Yep, LINQ does help...I've used to following to count/verify the number of appearances of refresh button:
<img height="24" border="0" width="24" title="Refresh the page" src="/vtdWeb/images/refresh.gif"/>

var images = (from b in Find.AllControls<HtmlImage>() where b.ToString().Contains("refresh.gif") select b);
Assert.True(images.Count() == 1);

Ta. 
Tags
General Discussions
Asked by
SD
Top achievements
Rank 1
Answers by
Konstantin Petkov
Telerik team
SD
Top achievements
Rank 1
Share this question
or