Reputation: 2633
Until now I just did like:
val radioButton4: WebElement = driver.findElement(By.id("FieldsubCode2"))
radioButton4.click
but now I want to find element by value, this value:
So I want to go:
val radioButton4: WebElement = driver.findElement(By.value("3.2"))
radioButton4.click
How can I do that?
Upvotes: 16
Views: 44597
Reputation: 668
In python, it's
driver.find_element_by_xpath("//input[@name='buttonName' and @value='3.2']")
Upvotes: 4
Reputation: 103
driver.FindElement(By.cssSelector(input[type='radio'][value='3.2']));
Upvotes: 5
Reputation: 559
If you want to find only by value then use,
driver.findElement(By.xpath("//input[@value='3.2']"));
Upvotes: 14
Reputation: 7036
driver.findElement(By.xpath("//input[@name='buttonName' and @value='3.2']"));
Upvotes: 10