You can use example below to click radio option with given label content.


HTML content


Step definition Then I check the "Multiple sizes" radio button.



FeatureContext.php


class FeatureContext extends MinkContext
{
/**
* @Then /^I check the "([^"]*)" radio button$/
*
* @param $radioLabel
* @throws \Behat\Behat\Exception\BehaviorException
*/
public function iSelectTheRadioButton($radioLabel)
{
$radioButton = $this->getSession()->getPage()->findField($radioLabel);

if (null === $radioButton) {
throw new BehaviorException("Element not found");
}

$this->getSession()->getDriver()->click($radioButton->getXPath());
}
}