0

I have a table that has the same 2 buttons on each row (Start, Cancel). I am trying to click the 'Start' button on the second row called 'Free Toys'. There are 2 buttons that are right next to each other: 1: Cancel 2: Start.

How can I click the 'Start' button for Free Toys which is located on the second row?

driver.find_element_by_xpath("//td[contains(text(), 'FreeToys')]//following-sibling::button[@class='btn btn-success btn-sm']").click()

HTML CODE for entire ROW

<tr ng-repeat="toyService in theServices" ng-class="{'text-muted': toyService.notFound}" class="ng-scope"> 
        <td style="text-align:center">
         <toy-up-down state="toyService.state" class="ng-isolate-scope"><span class="glyphicon glyphicon-arrow-down text-danger" title="Unknown" aria- hidden="true"></span></toy-up-down></td> 
   <td class="ng-binding">Free Toys</td> 
   <td class="ng-binding">Come get free toys</td> 
   <td class="toy-service-button-panel text-right">
          <button type="CANCEL" ui-sref="toyService.detail({id:toyService.id})" 
                 class="btn btn-info btn-sm toy-service-button-margin"info btn-sm toy-service-button-margin"                   
           ==The button I am trying to click is located below===
         <button type="START" class="btn btn-success btn-sm" (toyService.packageName)" 
                 ng-show="toyService.state !== 'Operational'" ng-disabledng-click="theStartClick
                  ="toyService.notFound" tabindex="0" aria-hidden="false" aria-disabled="false"> 
       </span> </button> 
       </td> </tr>
royalblue
  • 439
  • 2
  • 8
  • 18

0 Answers0