如何使用量角器js单击表格中的行按钮 [英] How to click a button in row in a table using protractor js

查看:107
本文介绍了如何使用量角器js单击表格中的行按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在撰写量角器测试用例。我想点击编辑按钮。当我通过 id 检查时,找不到它。

I am writing protractor test cases. I want to click on edit button. When I am checking by id it is not found.

代码:

<table class="table table-bordered table-hover">
   <thead>
       <tr>
          <th>Code</th>
          <th>Start Date</th>
          <th></th>
      </tr>
  </thead>
  <tbody>
      <tr ng-repeat="batch in batches.list">
         <td><a ui-sref="root.courses.detail.batches.assessments({ batch_id: batch.id,assessment_status: 'published'})">BID00{{batch.id}}</a></td>
         <td>{{batch.start_date}}</td>
         <td> 
             <button id="edit" type="button" class="btn btn-default btn-sm" tooltip-placement="top" tooltip="Edit" ng-controller="batchesCtrl" ng-click="edit_batch(batch.id)"><i class="glyphicon glyphicon-edit"></i></button> 
             <button type="button" id="delete(batch.id)" class="btn btn-danger btn-sm" tooltip-placement="top" tooltip="Delete" ng-click="remove_batch(1, batch.id)" confirmation-needed="Do you really want to delete this batch?"><i class="glyphicon glyphicon-trash" ></i></button>
         </td>
      </tr>
   </tbody>
</table>

我如何才能使它工作?

推荐答案

这里我没有发送延迟,所以我正在检查未加载按钮的情况
ptor.sleep(500);解决了我的问题。花了这么多时间来确定

Here i am not sending delay so what happen i am checking for the button which is not loaded ptor.sleep(500); fixes my problem. It took so much time to identify

这篇关于如何使用量角器js单击表格中的行按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆