简体   繁体   English

selenium webdriver中的复选框选择

[英]Checkbox selection in selenium webdriver

I am facing issue in checkbox selection, there id changing dynamically, so that I cant able click on that checkbox.我在选择复选框时遇到问题,ID 动态变化,因此我无法单击该复选框。 How to achieve that?如何做到这一点?

<a id="ext-gen208" class="x-menu-focus" href="#" onclick="return false;" tabindex="-1"></a>

You can use any of the xpath below:-您可以使用以下任何 xpath:-

//a[contains(@id, "ext-gen")]

OR或者

//a[starts-with(@id, "ext-gen")]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM