angular protractor no element found using locator

Problem

I am using protractor locator below and

element(by.css('.config1100 .btn btn-default btn-lg')).click();

getting following error

NoSuchElementError: No element found using locator: By.cssSelector(".config1100 .btn btn-default btn-lg")

html is templateURL of anuglar-ui view

<div class="row">
    <div class="config1100" ng-include="'../data/config1100.html'"></div>
    <p>
        <button type="button" class="btn btn-default btn-lg" ng-click="save()">Save</button>
    </p>
</div>
Problem courtesy of: irom

Solution

Might be simpler to use by.buttonText

element(by.buttonText('Save')).click();

http://www.protractortest.org/#/api?view=ProtractorBy.prototype.buttonText

If you have more than one button with that text, grab the collection with element.all and figure out which one you need.

Solution courtesy of: MBielski

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.