Having trouble selecting the 'Yes' and 'No' options on a page, I attempted to use JSExecutor since the normal 'Click()' function was not working. The issue is that while it is able to select the options, the value is not being sent as input, resulting in an error when attempting to proceed further.
I have experimented with various XPath methods without success!
WebElement st_1 = driver.findElement(By.id("app-select-no"));
((JavascriptExecutor)driver).executeScript("arguments[0].checked = true;", st_1);
Below is the HTML snippet:
div class="form-group input-form-group col-xs-6">
<input id="app-select-no" class="form-control ng-pristine ng-untouched ng-valid ng-valid-required" type="radio" ng-value="false" ng-model="openAccount.abc" required="" name="affRadioGroup" value="false" aria-checked="true" tabindex="0" aria-required="false" aria-invalid="false"/>
<label class="field-label-radio text-bold active" ng-class="{active : openAccount.abc==false}" for="app-select-no">
<span translate-once="NO_BUTTON">No</span>
</label>
</div>