Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 97792

How to identify an object in Selenium with No tags?

$
0
0

In my code, I need to verify that the text "Product successfully added to your shopping cart" is displayed after adding an item to cart. Here is the screenshot, and also the element. As we can see, the text does not have a tag, i.e something like text="Product Added to your shopping cart". Its like just floating there on its own.

enter image description here

Here is the full xpath of this text object : //*[@id="layer_cart"]/div[1]/div[1]/h2/text()

If I try to use this full path, I'm getting an error "object is text, it should be an element".

If I try to use until "[@id="layer_cart"]/div[1]/div[1]/h2", and dont include the 'text()', I cannot get the text and verify, because its really not part of the <i> tag. The result is just blank text. Any ideas? thanks


Viewing all articles
Browse latest Browse all 97792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>