I've a situation, where i need to click on element a[data-action='remove-criteria'] when a[data-action="edit-criteria"] matches string..
Any help, much appreciated!!
I've included code for this..
<table class="table table-striped"> <thead> <tbody> <tr scope="row"> <td>Own publishers</td> <td class="input-lg"> <div class="label label-primary">Contained in list</div> <a class="btn btn-default" data-value="22323" data-operator="list" data-attribute="pubs" data-section="supply_filter" data-action="edit-criteria" href="#">22323</a> <a class="text-danger" data-value="22323" data-operator="list" data-attribute="pubs" data-section="supply_filter" data-action="remove-criteria" href="#"/> <span>,</span> <a class="btn btn-default" data-value="223232323" data-operator="list" data-attribute="pubs" data-section="supply_filter" **data-action="edit-criteria"** href="#">223232323</a> <a class="text-danger" data-value="223232323" data-operator="list" data-attribute="pubs" data-section="supply_filter" **data-action="remove-criteria"** href="#"> </td> </tr> </tbody> </table>
matches string...clearly describe... and also share what have you tried??getText()matches '22323' then click on element a[data-action='remove-criteria'] but the problem i'm facing now is click on element a[remove-criteria] based on given string22323matches toa[data-action='remove-criteria']elements'sdata-valueattribute???xPathvalid for you//a[@data-action = 'remove-criteria' and @data-value = '22323']to get that link which matches provideddata-value