Selenium单选按钮无法点击

时间:2013-08-14 02:52:12

标签: java button selenium radio

我在使用硒方面遇到了很多麻烦,因为我甚至不了解xpath 作品。我正在尝试制作一个脚本,从可用按钮中选择一个随机单选按钮。下面是我感兴趣的页面部分的源代码:

<input class="answerListOption hideOther answerCommentRequired answerCommentRequired190620_0" type="radio" name="survey_answer[190620][]" value="686346" data-mustcomment="answerCommentRequired190620" />
        <span class="answerText">xBox</span>
    </label>
</li>
    <li class="answerRowBox_4">
    <label>
        <input class="answerListOptions answerlistradio" type="radio" name="survey_answer[190620][]" value="-3117" tabindex="-1"/>
        <span class="answerText">n/a</span>
    </label>
</li>
    <li class="e848aca52a896563b17cd1484b2e3805">
    <label>
        <input class="answerListOption hideOther answerCommentRequired answerCommentRequired190620_0" type="radio" name="survey_answer[190620][]" value="686347" data-mustcomment="answerCommentRequired190620" />
        <span class="answerText">PS4</span>
    </label>
</li>
    <li class="bae58c269d9264734bf527ceb86bcb86">
    <label>
        <input class="answerListOption hideOther answerCommentRequired answerCommentRequired190620_0" type="radio" name="survey_answer[190620][]" value="686348" data-mustcomment="answerCommentRequired190620" />
        <span class="answerText">N/A</span>
    </label>
</li>
    <li class="answerRowBox_4">
    <input type="text" name="survey_answer[190620][-5630]" class="inputText charCounter" maxlength="150" data-maxlength="150" name="Input3" value="" tabindex="-1" />
</li>
</ul>

它有几个不同的单选按钮,有不同的遮阳板。一个用于xbox,另一个用于ps3。我如何选择其中一个单选按钮?

我试图通过名称“survey_awnser”选择其中一个作为唯一不会改变的东西。

0 个答案:

没有答案