I am trying to get the option value of a select element using Protractor. However, I\'m not able to find the option element.
HTML
&l
Here is how you can get the value of an option in a select:
HTML
.spec file
describe("Country
To get the value of a selected option (which can be an option programmatically selected with protractor by calling click() on an option):
expect(
element(
by.model('model') //'model' is the string assigned to the select's ng-model attribute
).element(
by.css('option:checked')
).getAttribute('value')
).toEqual('Swizerland');