I am trying to click a check box which is left to the text(as-server).
My HTML code looks like this.
<td>
<input type="checkbox" ng-model="asset.isChecked" ng-change="selectEntity(filteredTableElements,asset.id)" class="ng-valid ng-dirty ng-valid-parse ng-empty ng-touched">
</td>
<td class="ng-binding">as-server</td>
I went through the Karate doc and tried multiple scenarios but none of them were able to find the checkbox.
Scenario1:
* leftOf('{}as-server').find('input[type="checkbox"]').click
()
output: evaluation (js) failed: leftOf('{}as-server').find('input[type="checkbox"]').click(), java.lang.RuntimeException: unable to find: {}as-server, LEFT, input[type="checkbox"] stack trace: com.intuit.karate.driver.ElementFinder.find(ElementFinder.java:120)
Scenario2:
* leftOf('{}as-server').click()
Output: evaluation (js) failed: leftOf('{}as-server').click(), java.lang.RuntimeException: unable to find: {}as-server, LEFT, INPUT stack trace: com.intuit.karate.driver.ElementFinder.find(ElementFinder.java:120)
Did I miss something here? Is there any other way of doing it in Karate?
Thanks!!