开发者

Selecting a dynamic checkbox in selenium using regex

I am trying to select a checkbox whose ids are generated dynamically but couldn't solve it.

Tried following

Selenium.check("id=regexp:ctl00_cphMa开发者_Python百科in_cbx_[a-zA-Z0-9_,]*")
Selenium.check("xpath=(//input[@type='checkbox'])[position()=1]")

Also this check box has only dynamic id, no name etc. any idea what I am doing wrong.

Regards


have you tried selenium.check('xpath=//input[@type='checkbox' and starts-with(@id,'ctl00_cphMain_cbx_')])

That should get what you are after

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜