1
votes

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>
2
Each class name in the selector should be specified with dot in front element(by.css('.config1100 .btn .btn-default .btn-lg')).click()Stubb0rn

2 Answers

4
votes

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.

2
votes

You were missing a dot, so using the dollar shortcut notation:

$('.config1100 .btn .btn-default .btn-lg')).click();