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

http://img2.mukewang.com/60a46cf10001b4c713450472.jpg

我无法在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_0

aria-activedescendant=189d67819beda8ebc9b5a2b7554f80f1_list_1

aria-activedescendant=189d67819beda8ebc9b5a2b7554f80f1_list_2

aria-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>


慕村9548890
浏览 389回答 3
3回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java