Reputation: 1
I cannot access the radio button with chrom websriver in selnium. I am writing my code in c# here is the code I am using
driver.FindElement(By.CssSelector("input[name=eventCategoryID]")).Click();
driver.FindElement(By.CssSelector("input[value=11]")).Click();
for this radio button
Upvotes: 0
Views: 1834
Reputation: 1989
You are missing some quotation marks. It should look like this:
driver.FindElement(By.CssSelector("input[name=\"eventCategoryID\"]")).Click();
driver.FindElement(By.CssSelector("input[value=\"11\"]")).Click();
The \ escapes the following quotation mark so that it doesn't end the string.
Upvotes: 2