2010-11-30 4 views
1
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 

21の要素をすべてカウントするために使用する式は何ですか?どのようにこの要素のselenium.GetXpathCount?

私は

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_.']"); 

を使用しましたが、それらのどれも働いていない...助けてください。

答えて

2

用途:

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

@Prostak:あなたはウェルカムです! –

関連する問題