2017-10-24 1 views
0

동일한 행의 해당 버튼에 대한 다른 관련 값을 기반으로 한 행의 버튼을 클릭해야합니다. 클릭해야합니다 버튼 NG-경우 텍스트를 기반으로 = "ctrl.showEdit"클래스 = 모두 위의 속성이 있습니다 "를 폭 25 NG 결합"TD 또는 클래스 다음의 'ABC'가 포함 당신이 역 추적 할 수 있도록이 같은 당신이 참고 자료로 사용할 값으로 열을 발견 일단 같은 행에각도기에서 다른 열 값을 기준으로 열을 클릭하는 방법

HTML Table

this.EditByName = function (input) { 
     element.all(by.className('table pagination-table-margin ng-scope ng-table')).then(function (rows) { 
      rows.forEach(function (row) { 
       row.all(by.className('ng-binding')).then(function (columns) { 
        element.all(by.cssContainingText(input)).then(function() { 
         element(by.className('btn-grid ng-scope')).click(); 
         console.log(input); 
        }); 
       }); 
      }); 
     }); 
    }; 

답변

0

당신은, XPath의 선택기를 사용해야합니다

element(by.cssContainingText("td", "abc")) 
    .element(by.xpath("..")) // This selects the parent <tr> 
    .all(by.css("button[ng-if='ctr.showEdit']"))