diff --git a/WebDriver/WebElement.php b/WebDriver/WebElement.php index 534d78e..11f8c62 100644 --- a/WebDriver/WebElement.php +++ b/WebDriver/WebElement.php @@ -222,16 +222,16 @@ public function move_cursor_relative($right, $down) { */ public function select_label($label) { - $this->get_next_element("//option[text()=" . WebDriver::QuoteXPath($label) . "]")->select(); + $this->get_next_element("xpath=option[text()=" . WebDriver::QuoteXPath($label) . "]")->select(); } public function select_value($value) { - $this->get_next_element("//option[@value=" . WebDriver::QuoteXPath($value) . "]")->select(); + $this->get_next_element("xpath=option[@value=" . WebDriver::QuoteXPath($value) . "]")->select(); } // 1-based index public function select_index($index) { - $this->get_next_element("//option[" . $index . "]")->select(); + $this->get_next_element("xpath=option[" . $index . "]")->select(); } public function select_random() {