find radiobutton by its type

This commit is contained in:
Jeffrey Guo 2014-05-23 11:16:50 +12:00
parent e7400a7c91
commit 86d8139f1b
1 changed files with 3 additions and 2 deletions

View File

@ -648,9 +648,10 @@ JS;
*/
public function iSelectTheRadioButton($radioLabel) {
$session = $this->getSession();
$radioButton = $session->getPage()->findField($radioLabel);
$radioButton = $session->getPage()->find('named', array(
'radio', $this->getSession()->getSelectorsHandler()->xpathLiteral($radioLabel)
));
assertNotNull($radioButton);
assertEquals('radio', $radioButton->getAttribute('type'));
$session->getDriver()->click($radioButton->getXPath());
}