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

423
Visualizações
How to check for tooltip message on mouse hover in Selenium?

I want to do mouseover function over Tooltip, which displays meessage.

Here is the link to video - https://screenrec.com/share/5IWTd4a7i9

For some reason hover does not happen due to which I do not get the text and test fails

This is what I have tried

browser.actions()
.mouseMove(
  element(by.xpath('/html/body/app-root/div/main/ng-component/ngb-tabset/div/div/view-concepts-tab/div[1]/concept-view/div/dl/mat-accordion/mat-expansion-panel/div/div/div[4]/term-view/div/div[3]/div[1]/dl/mat-accordion/mat-expansion-panel/mat-expansion-panel-header/span[1]/mat-panel-description/dd/span')))
.click()
.perform();

text('On mouse hover')

Also tried

    expect(element.all(by.xpath('/html/body/app-root/div/main/ng-component/ngb-tabset/div/div/view-concepts-tab/div/concept-view/div/dl/mat-accordion/mat-expansion-panel/div/div/div[2]/term-view/div/div[3]/div[1]/dl/mat-accordion/mat-expansion-panel/mat-expansion-panel-header/span[1]/mat-panel-description/dd/span'))).toEqual('On mouse hover');

EDIT

I got some success with below code, however error is Expected [ ] to equal 'On mouse hover'.

    expect(element.all(by.css('dd#A>span'))).toEqual('On mouse hover');

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You have to use atribute value of title then you will get the tooltip text. you dont have to scroll to the element.

expect(element(By.id("xyz")).getAttribute("title")).ToBe("Tool tip 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