I am doing automation testing using CucumberJS with Selenium Webdriver. I am trying to click on the radio button in a form using this piece of code :
try {
let gender = driver.findElement(By.css("input[type=radio][value=Miss.]"))
gender.click()
driver.sleep(7000)
} catch (ex) {
console.log(ex)
}
This is my React code using the Blueprint library :
<RadioGroup>
<Radio id="radio-gender-1" label="Mr." value="Mr." checked={this.state.title === "Mr."} />
<Radio id="radio-gender-2" label="Miss." value="Miss." checked={this.state.title === "Miss."} />
</RadioGroup>
But when I am running the test, it is throwing an error stating:
UnhandledPromiseRejectionWarning: InvalidSelectorError: invalid selector: An invalid or illegal selector was specified.
I can fill up the text boxes in the form but not able to click on the radio button.
Can you please help me with this?