Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

protractor no element found using locator by cssselector?

Getting my head around protractor... How can I access a button element on an angularjs page that looks like this:

<button class="button primary">Save</button>

Using this in my test:

element(by.css('button primary')).click();

Getting an error:

NoSuchElementError: No element found using locator: By.cssSelector("button primary")

How can I fix this?

like image 758
Pindakaas Avatar asked Oct 08 '14 00:10

Pindakaas


1 Answers

element(by.css('button.button.primary')).click();
like image 159
Leo Gallucci Avatar answered Oct 11 '22 16:10

Leo Gallucci