I've trying to click at option of a select and then click button save. I can see at the browser it's really works but when click at the button save, the google chrome doesn't understand and say I didn't click that required field. How to fix?
<select class="form-control ng-pristine ng-invalid ng-touched" id="ano-norma" required="">
<option disabled="" selected= "" value= "undefined" > Selecione um ano< /option>
<option value="2017" > 2017 < /option><option value="2016">2016</option >
<option value="2015" > 2015 < /option>
<option value="2014">2014</option >
<option value="2013" > 2013 < /option>
<option value="2012">2012</option >
<option value="2011" > 2011 < /option>
<option value="2010">2010</option >
<option value="2009" > 2009 < /option>
<option value="2008">2008</option >
</select>
I've tried:
element(by.id('ano-norma')).all(by.cssContainingText('option', '2017')).click();
and
element(by.id('ano-norma)).click().then( () => {
element(by.id('ano-norma)).all(by.tagName('option)).get(2).click();
});
I'm using google chrome as browser.
It's seems the google chrome don't understand that the dropdown was already selected.
"Campo obrigatório" means "required field"