c# - 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_chkproduct_20
what expression should use count 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_')]
Comments
Post a Comment