I have two radio buttons YES and NO, the step on the feature file can pass argument to the method, both radio buttons has the same name so I want to click on the radio button by finding its name and value for example:
def licenceStatus(licenceS)
licence = @driver.find_element(name:"licence_status", value:licenceS).click
end
The above method works in Watir but not Selenium how do I get this to work?
alecxe
11.4k11 gold badges52 silver badges107 bronze badges
-
The step on the feature file can pass argument like "Yes" or "No" to the method.user3341382– user33413822017年06月21日 11:08:26 +00:00Commented Jun 21, 2017 at 11:08
2 Answers 2
If you familiar with css you can use css selector format
driver.find_element(:css,"[name='radioBtn'][value='1']")
answered Jul 21, 2017 at 21:00
Try the following xpath with ruby
browser.find_element(:xpath => "//*[@name='licence_status' and @value='licenceS']").click()
default