I'm new to Protractor, I'm trying to set the radio button value using Protractor. I searched over the internet and the SO for the answers which went vain.
html:
<md-radio-group
id="radiogrp1"
name="radiogrp1"
ng-model="application.myRadioGrp"
required>
<md-radio-button value="N" aria-label="No">No</md-radio-button>
<md-radio-button value="Y" aria-label="Yes">Yes</md-radio-button>
<md-radio-button value="M" aria-label="Maybe">May</md-radio-button>
</md-radio-group>
From the above html file, I tried to set No/Yes/Maybe while executing in my jasmine it() with some Protractor code like shown below:
element.all(by.id('radiogrp1)).get(0).click();
For this above code it default accepts yes alone. I want specifically set any value of radio group i.e., child(md-radio-button) like Yes/No/Maybe of parent(md-radio-grp). I tried in many ways like bind, map etc., but nothing helped really. Looking for help. Thanks in advance.
Try:
element(by.id('radiogrp1')).all(by.tagName('md-radio-button')).get(0).click();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With