Location of pseudo-elements (xpath)

Asked

Viewed 70 times

0

inserir a descrição da imagem aqui

Good morning, everyone!

I have the following scenario (print attached). In order to automate my test, I would like to locate the message "Product successfully Added to your Cart" in my test through xpath. How do I proceed with ::before??

I await some return!

Thank you!

  • Someone could help me?

1 answer

1


There are some spaces between the text, you will need to use the function normalize-space to find only the text "Product successfully Added to your Cart".

//h2[normalize-space(text()='Product successfully added to your cart')]

Browser other questions tagged

You are not signed in. Login or sign up in order to post.