Home > Automation Testing > Protractor locators

Protractor locators

Protractor locators:

Protractor is wrapper of Selenium Javascript Webdriver. All the locators of selenium webdriver is supported in protractor along with these locators protractor supports angularJS specific attributes ng-model, ng-repeat, ng-options, ng-binding.

Here are the list of locators supported by protractor:

  • buttonText
  • partialButtonText
  • binding
  • exactBinding
  • model
  • cssContainingText
  • options
  • deepCss
  • repeater
  • exactRepeater
  • className
  • css
  • id
  • linkText
  • js
  • name
  • partialLinkText
  • tagName
  • Xpath

Syntax of Model locator:

element(by.model(‘modelName’));

Syntax of binding locator:

element(by.binding(‘bindingName’));

Syntax of repeater locator:

element.all(by.repeater(‘RepeaterName’)).get(index);

Above syntax in get() function we need to mention the index which starts from Zero.

This Article is TAGGED in . BOOKMARK THE permalink.

Avatar photo
Amit Bharamasali
Automation Software Test Engineer. Skills: Manual Testing, Selenium, Java, Protractor, JavaScript, Katalon Studio, Groovy, Appium, Sahi, Sahi Script and UI/UX testing.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">