C# 如何为该元素创建selenium.GetXpathCount?

C# 如何为该元素创建selenium.GetXpathCount?,c#,xpath,selenium,rc,C#,Xpath,Selenium,Rc,我应该使用什么表达式来计算所有21个元素 我用过 ctl00_Content_ctl00_chkProduct_0 ctl00_Content_ctl00_chkProduct_1 ctl00_Content_ctl00_chkProduct_2 ... ctl00_Content_ctl00_chkProduct_19 ctl00_Content_ctl00_chkProduct_20 但是没有一个有效。。。请帮助。使用: decimal count = selenium.GetXpathC

我应该使用什么表达式来计算所有21个元素

我用过

ctl00_Content_ctl00_chkProduct_0
ctl00_Content_ctl00_chkProduct_1
ctl00_Content_ctl00_chkProduct_2
...
ctl00_Content_ctl00_chkProduct_19
ctl00_Content_ctl00_chkProduct_20
但是没有一个有效。。。请帮助。

使用:

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_.']");
//*[starts-with(@id,'ctl00_Content_ctl00_chkProduct_')]