I am trying to check the text inside a span element which is very deep down the dom tree, and I dont want to use a sequence of get/find command to find the text, here is my dom structure looks like:
<td>
<div>
<div>
<div>
<div></div>
<div>
<div>
<div> </div>
<span> **target** </span>
</div>
</div>
</div>
</div>
<div>
...
</div>
</div>
</td>
thanks for the help
You could get the first
div element
and find by span.example:
If the
parent div element
has a CSS class or some unique attribute, it would be easier.ref: https://docs.cypress.io/api/commands/get#Get-vs-Find