The expected: Select random one an assignment has status "Not start". Here is my table:

    <table id="table1">
     <tbody>
      <tr class="odd1">
       <td>
        <a href="#" class="click_link"> Assignment 1 </a>
       </td>
       <td class="status">
        In Progress
       <td>
      </tr>
      <tr class="odd2">
       <td>
        <a href="#" class="click_link"> Assignment 2 </a>
       </td>
       <td class="status">
        Not start
       <td>
      </tr>
      <tr class="odd1">
       <td>
        <a href="#" class="click_link"> Assignment 3 </a>
       </td>
       <td class="status">
        Not start
       <td>
      </tr>
      <tr class="odd1">
       <td>
        <a href="#" class="click_link"> Assignment 4 </a>
       </td>
       <td class="status">
        Not start
       <td>
      </tr>
     </tbody>
    </table>

Solution: I group [td] elements have status "Not Start" in the array, then get the parent [tr] of the first [td][0]. Finally, from [tr] I find and click the link. How to do this? Thanks a lot!

1

There are 1 best solutions below

0
On

Worked with jquery:

I.executeScript(function() {
    var abc = $("#table1 td:contains('Not Start')").parent("tr").children("td:first").children().text();
    return abc;
    });