Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

342
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda