使用Selenium / java处理开关

时间:2015-02-06 02:31:28

标签: selenium xpath

我既不能识别开关也不能获得其当前值(开/关)。

请帮忙看看

  • 尝试使用xpath =" // span [@class =' onoffswitch-inner'并包含(@id,' aui')]"但是识别这个按钮

  • 并没有帮助
  • " ID"是一个动态的,一旦加载页面就会被更改

代码:

<li id="aui_3_4_0_1_1099">
<div id="aui_3_4_0_1_1098" class="onoffswitch">
<input id="notificationActive" class="onoffswitch-checkbox" type="checkbox" autocomplete="off" checked="checked" name="notificationActive"></input>
<label id="aui_3_4_0_1_1097" class="onoffswitch-label" for="notificationActive">
<span id="aui_3_4_0_1_1096" class="onoffswitch-inner">
::before
::after
</span>
<span class="onoffswitch-switch"></span>
</label>
</div>
</li>

谢谢,

0 个答案:

没有答案