开发者

How to selenium.GetXpathCount for this element?

开发者 https://www.devze.com 2023-01-27 12:28 出处:网络
ctl00_Content_ctl00_chkProduct_0 ctl00_Content_ctl00_chkProduct_1 ctl00_Content_ctl00_chkProduct_2 ... ctl00_Content_ctl00_chkProduct_19
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

精彩评论

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

关注公众号