为了账号安全,请及时绑定邮箱和手机立即绑定

我无法找到/找到Selenium中的下拉列表的xpath

我无法找到/找到Selenium中的下拉列表的xpath

慕村9548890 2021-05-13 18:25:49
我无法在Selenium中的下拉列表中找到/找到xpath,下拉列表是使用div标签编写的,并且悬停时更改了attribute(aria-activedescendant)值。在下拉列表中选择的值一经出现,attribute(aria-activedescendant)值就会消失。有什么可以帮助我为此找到xpath的吗?提前致谢。HTML如下:<div class="DropdownWidget---dropdown_value DropdownWidget---placeholder"id="189d67819beda8ebc9b5a2b7554f80f1_value" role="listbox" tabindex="0" aria-controls="189d67819beda8ebc9b5a2b7554f80f1_list" aria-expanded="false" aria-activedescendant="" aria-labelledby="189d67819beda8ebc9b5a2b7554f80f1" aria-describedby="189d67819beda8ebc9b5a2b7554f80f1_selectedChoice" aria-required="true"><!-- react-text: 38 -->- Please Select a Value -<!-- /react-text --><span id="189d67819beda8ebc9b5a2b7554f80f1_selectedChoice" class="DropdownWidget---accessibilityhidden">- Please Select a Value -</span> </div>鼠标悬停时,属性值正在更改,如下所示:aria-activedescendant=189d67819beda8ebc9b5a2b7554f80f1_list_0aria-activedescendant=189d67819beda8ebc9b5a2b7554f80f1_list_1aria-activedescendant=189d67819beda8ebc9b5a2b7554f80f1_list_2aria-activedescendant=189d67819beda8ebc9b5a2b7554f80f1_list_3以下是检查的选项代码:<div class="DropdownWidget---dropdown_value DropdownWidget---placeholder" id="189d67819beda8ebc9b5a2b7554f80f1_value" role="listbox" tabindex="0" aria-controls="189d67819beda8ebc9b5a2b7554f80f1_list" aria-expanded="true" aria-activedescendant="189d67819beda8ebc9b5a2b7554f80f1_list_2"  aria-labelledby="189d67819beda8ebc9b5a2b7554f80f1" aria-describedby="189d67819beda8ebc9b5a2b7554f80f1_selectedChoice" aria-required="true">  <!-- react-text: 38 -->- Please Select a Value -  <!-- /react-text --><span id="189d67819beda8ebc9b5a2b7554f80f1_selectedChoice" class="DropdownWidget---accessibilityhidden">- Please Select a Value -</span></div>
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 388 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信