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));
精彩评论