Question

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

Quelle expression dois-je utiliser pour compter les 21 éléments?

Je l'ai utilisé

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

mais aucun d'entre eux a travaillé ... aide s'il vous plaît.

Était-ce utile?

La solution

Utilisation:

//*[starts-with(@id,'ctl00_Content_ctl00_chkProduct_')]
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top