tags:

views:

54

answers:

2

How to find element by start of id in WatiN?

Find.ById(x => x.StartsWith(rel)

Didn't work somehow. :/

+1  A: 

RegEx pwnage =>

 var regex = new Regex(rel + ".*");
 var links = Browser.ElementsOfType<Link>()
     .Filter(Find.By("rel", regex));
Arnis L.
+1  A: 

Hi,

You probably need to check whether x has a value before calling StartsWith()

Find.ById(x => x != null && x.StartsWith(rel))

HtH, Jeroen

Jeroen van Menen
Found this too, but somehow got problems. Maybe that was my own fault. Focusing on other problems at the moment.
Arnis L.