如何使用量角器定位器找到子元素?

问题描述 投票:1回答:3

你能在以下DOM中为<input>元素建议定位器吗? by.repeater只让我到<td>元素。任何后续的量角器定位器都没有找到下面的<input>元素。先感谢您!

<table class="table table-striped table-hover">
    <thead>
    <tbody class="ng-scope" ng-repeat="devices in collection track by $index" >
        <tr class="ng-scope ng-isolate-scope"  st-select-row="devices" st-select-mode="single">
        <td>
            <chk-select class="ng-isolate-scope" emitselectedrec="selectedRows" chkmode="multiple" rowobj="clusters">
                <input type="checkbox" ng-transclude="" ng-click="pushToSelected(row)" uid="1">
           </chk-select>
        </td>
      </tr>
    </tbody>
</table>
javascript angularjs selenium selenium-webdriver protractor
3个回答
0
投票

如果您依赖于chk-select元素并且它的rowobj属性,该怎么办:

element(by.css("chk-select[rowobj=clusters] input[type=checkbox]"));

0
投票

你可以使用JavascriptExecutior驱动程序。我会很快提高你的答案,但你可以用这个驱动程序做很多事情。


-1
投票

在你的情况下,它只是element(by.css('input'))

© www.soinside.com 2019 - 2024. All rights reserved.