开发者

How to selenium.GetXpathCount for this element?

ctl00_Content_ctl00_chkProduct_0
ctl00_Content_ctl00_chkProduct_1
ctl00_Content_ctl00_chkProduct_2
...
ctl00_Content_ctl00_chkProduct_19
ctl00_Content_ctl00_chkProdu开发者_StackOverflow社区ct_20

What expression should I use to count all 21 elements?

I've used

decimal count = selenium.GetXpathCount("//*[@id='ctl00_Content_ctl00_chkProduct_.*']");
decimal count = selenium.GetXpathCount("//*[@id='ctl00_Content_ctl00_chkProduct_[.*]']");
decimal count = selenium.GetXpathCount("//*[@id='ctl00_Content_ctl00_chkProduct_.']");

but none of them worked... please help.


Use:

//*[starts-with(@id,'ctl00_Content_ctl00_chkProduct_')]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜