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

How to find element with "== $0" after end tag in html using Xpath, css or any other locators in Selenium

$
0
0

I have to find element with "== $0" after end tag of "span". Below is the HTML Code of element.

<div _ngcontent-c6="" class="col-12">
<span _ngcontent-c6="">Registration with prefilled user's data</span>
</div>

Although while I have copied the html code it is removing "== $0" itself. so I am attaching image also.

enter image description here

I have tried to find out solution but it was not working. I have tried xpath that normally works like .//span[text()='Registration with prefilled user's data'], but no sucess. I just found that "we can access this element in chrome console with syntax ' $0' and it is working fine there

enter image description here

but I do't know how to find it with xpath and CSS or any recommended locator's strategies in Selenium.

Note: Please don't mention any work around say use className or css with class name like div.col-12 span as I knew already this. My problem is handling elements with == $0.


Viewing all articles
Browse latest Browse all 97756

Trending Articles



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