Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

337
Vistas
Selenium: Drop Down list with div tag instead of select tag

I am new to automated testing with Selenium Web Driver. I am not able to figure it how to test drop down lists of the location type without using the select command. I have div tag.

I was trying to send keys but did not work.

I am working on this website: https://freightpower.schneider.com (>>get a quote>>less than truckload) You may then need to register but it is very quick.enter image description here

enter image description here

 driver.find_elements(by=By.XPATH, value = '//div[@class="dropdownstyle__StyledValueContainer-sc-13n3p0k-2 dIpAqS"]')[0].click()

Then I need to choose one of the options but could not do it. Any help would be appreciated ! I know how I can choose if I could have select tag but now I do not have it and really do not know what to do although checking many related questions.

enter image description here

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

In my project, I am using selenium automated test. There is an selection box that includes hospital names and user choose hospitals. Maybe you can use find_element_by_id and find_elements_by_tag_name together like this:

try:
    el = driver.find_element_by_id('hospital_name')
    for option in el.find_elements_by_tag_name('option'):
        if option.text == 'Mount Sinai West':
            time.sleep(5)
            logging.info("Hospital name was added")
            option.click()
            break
except Exception as e:
    logging.exception(e)
    raise e
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda