开发者

WatiN FindByIdStartsWith?

开发者 https://www.devze.com 2022-12-16 13:31 出处:网络
How to find element by start of id in WatiN? Find.ById(x => x.StartsWith(rel) 开发者_StackOverflow中文版Didn\'t work somehow. :/RegEx pwnage =>

How to find element by start of id in WatiN?

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

开发者_StackOverflow中文版Didn't work somehow. :/


RegEx pwnage =>

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


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

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

精彩评论

暂无评论...
验证码 换一张
取 消