From acff6158942acbfc7b482ad793af87880e022f62 Mon Sep 17 00:00:00 2001 From: JeffreyWay Date: Mon, 13 Apr 2015 12:19:18 -0400 Subject: [PATCH] Fix hardcoded value --- src/Extensions/Selenium.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Extensions/Selenium.php b/src/Extensions/Selenium.php index de23294..9836fae 100644 --- a/src/Extensions/Selenium.php +++ b/src/Extensions/Selenium.php @@ -148,7 +148,7 @@ protected function findByValue($value, $element = 'input') return $this->session->element('css selector', "{$element}[value='{$value}']"); } catch (NoSuchElement $e) { try { - return $this->session->element('xpath', "//button[contains(text(),'Register')]"); + return $this->session->element('xpath', "//button[contains(text(),'{$value}')]"); } catch (NoSuchElement $e) { throw new InvalidArgumentException( "Crap. Couldn't find an {$element} with a 'value' attribute of '{$value}'. We also looked " .