Protractor “by.css()” vs “$()” Dollar Sign vs “$$()” ‘Bling Bling’

$ and $$ are just convenient shortcuts.

$("selector") is an alternative for element(by.css("selector")).

$$("selector") is an alternative for element.all(by.css("selector")).


FYI, quote from the source code:

ElementFinder.prototype.$ = function(selector) {
  return this.element(webdriver.By.css(selector));
};

ElementArrayFinder.prototype.$$ = function(selector) {
  return this.all(webdriver.By.css(selector));
};

And the actual commit that initially made it happen.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)