Lakmal Rajith
Lakmal Rajith

Reputation: 71

Protractor-Identifying elements?

I am trying to identify an element in the following code to automate the input of a text field using protractor, any comments are much appreciated & here is the code,

<input ng-disabled="!cell.editable"
    name="99286434"
    class="form-control ng-pristine ng-valid ng-valid-required ng-touched" 
    ng-class="{'is-required':cell.field.required &amp;&amp; !xxx.xxx.data}" 
    ng-model="xxx.xxx.xxx" 
    ng-change="dataChanged(cell)" 
    ng-required="cell.field.required" 
    ng-trim="false" 
    type="text">

Thanks in advance.

Upvotes: 0

Views: 87

Answers (1)

yong
yong

Reputation: 13712

You can use by.model

element(by.model('xxx.xxx.xxx'))

or

element(by.css('input[ng-model="xxx.xxx.xxx"]'))

If both can't work, check the element inside a frame, add some sleep/wait prior to find the element.

Upvotes: 1

Related Questions