1

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?

1
  • The step on the feature file can pass argument like "Yes" or "No" to the method. Commented Jun 21, 2017 at 11:08

2 Answers 2

1

If you familiar with css you can use css selector format

driver.find_element(:css,"[name='radioBtn'][value='1']")
0

Try the following xpath with ruby

browser.find_element(:xpath => "//*[@name='licence_status' and @value='licenceS']").click()
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.