2010-11-30 2 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 : 당신은 웰컴입니다! –

관련 문제