0

I am new to building automation using Protractor.

Can you please help me in identifying which locator I can use to capture a element which is a text box field in my protractor tests?

Below is the HTML I captured from Firebug:

input class="input ng-pristine ng-valid" type="text" ti-autosize="" ti-bind-attrs="{type: options.type, placeholder: options.placeholder, tabindex: options.tabindex, spellcheck: options.spellcheck}" ng-class="{'invalid-tag': newTag.invalid}" ng-trim="false" ng-paste="eventHandlers.input.paste($event)" ng-blur="eventHandlers.input.blur($event)" ng-focus="eventHandlers.input.focus($event)" ng-keydown="eventHandlers.input.keydown($event)" ng-change="eventHandlers.input.change(newTag.text)" ng-model="newTag.text" placeholder="20 numbers remaining" style="width: 135px;" spellcheck="true"
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195

1 Answers1

0

There are multiple ways to find the element, for example:

  • by.model:

    element(by.model('newTag.text'))
    
  • by.css:

    element(by.css('input.input'))
    
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195