From f0edd9d8f6d939237e5556641bd6a1db2580ff05 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Fri, 13 Feb 2015 16:15:49 +0000 Subject: [PATCH] MDL-49205 behat: fix I set the field with xpath fail message. --- lib/tests/behat/behat_forms.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/tests/behat/behat_forms.php b/lib/tests/behat/behat_forms.php index 1a820991b9e..f7a5a529e65 100644 --- a/lib/tests/behat/behat_forms.php +++ b/lib/tests/behat/behat_forms.php @@ -169,11 +169,7 @@ class behat_forms extends behat_base { * @return void */ public function i_set_the_field_with_xpath_to($fieldxpath, $value) { - try { - $fieldNode = $this->find('xpath', $fieldxpath); - } catch (\Behat\Mink\Exception\ElementNotFoundException $e) { - throw new ElementNotFoundException('Field with xpath ' . $fieldxpath . 'not found, so can\'t be set'); - } + $fieldNode = $this->find('xpath', $fieldxpath); $field = behat_field_manager::get_form_field($fieldNode, $this->getSession()); $field->set_value($value); } -- 2.43.0