diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php index 86218117..6f57e679 100755 --- a/src/Selenium2Driver.php +++ b/src/Selenium2Driver.php @@ -750,7 +750,12 @@ public function setValue(string $xpath, $value) $element->postValue(array('text' => Key::DELETE)); } else { - $existingValueLength = strlen($element->attribute('value')); + if ($this->isW3C()) { + $existingValueLength = strlen($element->property('value')); + } + else { + $existingValueLength = strlen($element->attribute('value')); + } $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value; } }