Selecting from div class dropdown - Selenium

后端 未结 3 783
悲哀的现实
悲哀的现实 2021-01-22 09:34

I\'m trying to select an option from a drop-down that doesnt populate until the locator has been clicked. This is what I see in Firebug:

div class=\"selectize-i         


        
3条回答
  •  無奈伤痛
    2021-01-22 10:21

    This isn't a normal drop-down select menu. Hence, using Select won't work in this case. Without seeing the complete site, I'm not sure what exactly must be done to select it.

    But try simply clicking on the div element when the options in the dropdown are visible.

    //I'm assuming that this will display the dropdown list
    driver.findElement(byAgentCodes).click(); 
    
    driver.findElement(By.xpath("//div[@data-value='523-23-20275']"));
    

提交回复
热议问题