1

I'm having an issue where I cannot select the ID or items in the select2 drop-down menus using Selenium.

driver.find_element_by_xpath("//select[@name='propertymanagementtype']/option[text()='Managed let']").click()

HTML code

<select name="propertymanagementtype" id="propertymanagementtype">
   <option selected VALUE=1>Managed let</option>

I received the error messages Element is not currently visible, but yet clearly exists within the framework. The web application I'm using has Select2 installed. I asked on selenium boards as to why select2 is having issues when I'm trying to create selenium scripts. If anyone knows how to bypass this please let me know.

Josh Yu
  • 11
  • 3
  • 2
    Possible duplicate of [Selenium - Python - drop-down menu option value](https://stackoverflow.com/questions/7867537/selenium-python-drop-down-menu-option-value) – Guy Oct 24 '18 at 10:21
  • 1
    Look at the top voted answer, not the accepted one. – Guy Oct 24 '18 at 10:21
  • @JoshYu Update the question with the relevant HTML – undetected Selenium Oct 24 '18 at 11:10
  • I have tried similar, these things already. I believe the issue is that select2 is hiding the ID's – Josh Yu Oct 24 '18 at 15:33
  • As @Guy indicated, the second option should work, there's really no reason it should not. When you have a web element specifically tagged as "select" you should take advantage of the built-in class of select in Selenium to handle it properly. – Bill Hileman Oct 24 '18 at 17:26

0 Answers0