【发布时间】:2018-11-21 10:49:01
【问题描述】:
以下问题是否有任何代码?我无法编写正确的 XPath 或 CSS 来为下面的代码选择标题“MRS”。我正在使用下面的代码,但无法执行。
driver.findElement(By.xpath("//div[@value='MRS']")).click();
<div class="question-controls clearfix">
<div class="question-group ">
<label class="off">Mr</label>
<input type="radio" name="title" value="MR" class="ui-helper-hidden-accessible">
<label class="off">Mrs</label>
<input type="radio" name="title" value="MRS" class="ui-helper-hidden-accessible">
<label class="on">Miss</label>
<input type="radio" name="title" value="MISS" class="ui-helper-hidden-accessible">
<label class="off">Ms</label>
<input type="radio" name="title" value="MS" class="ui-helper-hidden-accessible">
<label class="off">Dr</label>
<input type="radio" name="title" value="DR" class="ui-helper-hidden-accessible">
<label class="off">Rev</label>
<input type="radio" name="title" value="REV" class="ui-helper-hidden-accessible">
<input type="text" maxlength="20" style="display:none" name="otherTitle" value="" placeholder="Other title:" id="otherTitle">
</div>
</div>
参考链接:
【问题讨论】:
-
我疯了还是您的“参考链接”是您问题的链接?我们需要一个指向该页面的链接。
-
- 我看到一个没有收音机的登录页面。
-
需要登录才能看到该页面,我不能提供登录详细信息
-
那你可能得不到好的答案,抱歉。
标签: java selenium selenium-webdriver xpath webdriverwait