0

I need to find the index of the table where the value of the first column is equal to a string for example "Test" . how do write that in GEB ?

<table class="table table-striped table-bordered dataTable no-footer" id="mytable">
        <thead>
             <tr>
                  <th >libelle </th> 
                  <th >description</th> 

             </tr>
        </thead>
        <tbody>
           <c:forEach var="value" items="${values}" varStatus="status">
             <tr>
                <td>${value.libelle}</td>
                <td>${value.description}</td>

             </tr>
           </c:forEach>
        </tbody>
 </table>

I've started with :

def index =$("#mytable tbody tr").find("tr", it).find("td", 0)

but didn't know how to put the text I'm looking for

Yuri
  • 447
  • 3
  • 9
  • 19

1 Answers1

0

would this maybe sufficient? (from here)

$('td', contains('some text')).parent() // this should give you the row

Or do you really need the index?

Michael K.
  • 2,392
  • 4
  • 22
  • 35