From 9820e09af192b03688f5b9e4088db1ca2f8671a0 Mon Sep 17 00:00:00 2001 From: Sally Young Date: Tue, 6 Feb 2024 15:46:02 +0000 Subject: [PATCH] Use property only for w3c mode --- src/Selenium2Driver.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Selenium2Driver.php b/src/Selenium2Driver.php index 3246ee34..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->property('value')); + if ($this->isW3C()) { + $existingValueLength = strlen($element->property('value')); + } + else { + $existingValueLength = strlen($element->attribute('value')); + } $value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value; } }