mardi 31 mai 2016

Protractor: Syntax to select elements based on html attributes

I want to select this element:

 <span class="required" ng-class="{'disabled': saveInProgress}" 
 input-control="{okCallback:setFieldValue, params:['firstName'], 
 title:'First Name', value: person.firstName, 
 validate:{length:100},empty:false}">
     <span hs-placeholder="Type First Name" class="ng-binding"></span>
 </span>

And this one too:

 <span class="required" ng-class="{'disabled': saveInProgress}" 
  input-control="{okCallback:setFieldValue, params:['lastName'], 
  title:'Last Name', value: person.lastName, validate:{length:100}}">
      <span hs-placeholder="Type Last Name" class="ng-binding">
      </span>
 </span>

I tried to do so using

 var input = element(by.css('span.required span.ng-binding'));  
 browser.actions().mouseMove(input).click().perform();

But it kept on calling the first name element only. Any ideas? please :)

Aucun commentaire:

Enregistrer un commentaire