Search code examples
robotframework

How to select an element containing text with Robot Framework?


I want to select an element named Uncheck All. The element is not a check box, it's a link.

I tried this:

//*[@class=n'g-scope ng-isolate-scope' and contains ('Uncheck All')

It can't find the element.

<div id="channel-groups-div-0" class="box-wrapper fn-toggle-content no- script" style="display: block;">
<div class="box-action">
<span id="deselect-all-0" class="select-all">Uncheck All</span>
<span>&nbsp;|&nbsp;</span>
<span id="select-all-0" class="select-all">TCheck All</span>
</div>

Any help would be good, thank you.


Solution

  • This xpath will work for the code snippet you provided:

    //span[@class='select-all' and text()='Uncheck All']