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

252
Visualizações
Selenium / Java : How to write element locator for an element with aria-selected=false

We are unable to locate and click at an element with "aria-selected" = "false" on an HTML page. We have tried different way to write xpath locator and css selector but none of them worked. While inspecting a bit more on page, we found that this element has a "aria-selected="false" in it and when we click on it and it shows results then this value changes to "aria-selected="true"

enter image description here

We have tried with below xpath:

(".//*/span[@class='tab-button-text'][contains(text(),'Orders')]")

Note: Even though it does not matter which framework, we are using to use this element. However i would like to mention that, we have been trying it for two separate framework such as

  1. Karate framework and other one,
  2. Selenium, Cucumber BDD with java
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

ariaSelected

The ariaSelected property of the Element interface reflects the value of the aria-selected attribute, which indicates the current "selected" state of elements that have a selected state.

Value: A DOMString with one of the following values:

  • true: The item is selected.
  • false: The item is not selected.

Selected/unselected state of this WebElement attribute doesn't effects your tests.


To locate the element you can you can use either of the following Locator Strategies:

  • xpath:

    ("//span[@class='tab-button-text' and contains(text(),'Orders')]")
    
  • cssSelector:

    ("div.tabbar.show-tabbar > a.tab-button.has-title.has-icon span.tab-button-text")
    
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