gpt4 book ai didi

javascript - 如何从 Dropdown 中选择具有 SELECT OPTION 标签的元素?

转载 作者:行者123 更新时间:2023-12-03 01:18:37 26 4
gpt4 key购买 nike

我正在使用WEBDRIVERIO框架。我有一个 html 语法的下拉菜单。我尝试使用 ID=question-3 来扩展它

之后,我使用 SELECT by 选项、值、文本尝试了所有选项。但由于它显然不是 SELECT DROPDOWN,所以没有任何效果。我尝试根据输入或标签选项单击定位器,但收到“元素不可见”错误消息。

<div id="question-3" class="question ">
<div class="single-dropdown">
<input type="text" name="input-3" class="js-single-selection" placeholder="gender" data-question-id="3" data-index="3" readonly="" style="width: 77px;">
<div class="single-select-container" style="display: none;">
<div class="single-select-item" data-image="">
<label for="option-0-3" data-open="exampleModal1" class="option-0-3-modal">man</label>
<input type="checkbox" id="option-0-3" data-answer-type="single" data-question-id="3" value="man" data-index="3">
</div>

<div class="single-select-item checked" data-image="">
<label for="option-1-3" data-open="exampleModal1" class="option-1-3-modal">woman</label>
<input type="checkbox" id="option-1-3" data-answer-type="single" data-question-id="3" value="woman" data-index="3">
</div>
</div>
</div>
.</div>

最佳答案

由于 html 显示了一个输入标记。我建议:

 1. type the value in that input box (placeholder="gender")
2. wait for options to appear (Label tag)
3. click the appeared item.(Appeared label)

此外,如果您的方案失败,请提供失败的堆栈跟踪。

关于javascript - 如何从 Dropdown 中选择具有 SELECT OPTION 标签的元素?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51867371/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com