javascript - Can't use chained locator in protractor -


i need test 2 textboxes. here's page view:

<div class="wrap-ctrl ng-scope" ng-switch-when="input">                     <input type="text" name="surnameinput" class="text-field ng-pristine ng-isolate-scope ng-pending ng-touched" data-ng-class="::surnamefeature ? 'box-ctrl_tooltip' : ''" placeholder="input surname" data-ng-model="input.surname" ng-model-options="{updateon: 'blur'}" data-input-type="fio-surname" data-dts-input="" data-ng-disabled="$root.isdisabled(prefix + 'surnameinput')" data-validator="restrictvalue, required, percentcyrillic=50" data-message-id="surnameerrors" data-warning="istruegendersurname" data-warning-id="surnamewarnings">                      <!-- ngif: ::surnamefeature -->                      <!-- ngif: ::surnamefeature -->                      <div id="surnameerrors" class="form-error-messages"></div>                     <div id="surnamewarnings" class="form-error-messages"></div>                 </div>      <div name="name" data-ng-class="::namefeature ? 'box-ctrl_tooltip' : ''" placeholder="input name" data-ng-model="person.name" data-options="item item item in data.items, count data.totalcount" data-data-limit="10" data-min-length="2" data-is-search-from-start="true" data-ng-params="urlparams()" data-url="/test/api/autocomplite/names/" data-input-type="fio-name" data-dts-typeahead="" custom-class="wrap-ctrl angucomplete-holder" data-ng-disabled="$root.isdisabled(prefix + 'name')" data-validator="restrictvalue, required, percentcyrillic=50" data-message-id="nameerrors" warning="istruegendername" data-warning-id="namewarnings" class="ng-untouched ng-isolate-scope tt-container wrap-ctrl angucomplete-holder ng-pending ng-dirty ng-valid-parse"><input class="tt-hint text-field" type="text" tabindex="-1" style="opacity: 1;"><input class="tt-input text-field" type="text" dts-highlighter="focus" placeholder="input name"></div> 

(http://pastebin.com/y9apwst4)

i have no issue first one, can't hands on second one.

var surname = element(by.model('input.surname'));  var name = element(by.model('person.name'));  surname.click().sendkeys('smith'); //works great name.click().sendkeys('john'); //doesn't work 

i got tip friend should use chained locator, tried this:

var name = element(by.model('person.name').element(by.css('input:not([tabindex="-1"])'))); 

but doesn't work either. advice?

var name = element.all(by.model('person.name')).get(0).element(by.css('[dts-highlighter="focus"]')); 

Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -