0

I'm having strange behavior while trying to get input text value:

$this->byXPath( "//input[contains(@id, '_rule_1_display_times')]" )->value();

Error output:

PHPUnit_Extensions_Selenium2TestCase_WebDriverException : GET /session/3ef42f7e-f5f5-459d-92e2-6377c6f05e61/element/4/value Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50' System info: host: 'vytautas', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-49-generic', java.version: '1.7.0_75' Driver info: driver.version: unknown

It's strange cause I can set value to this input without any problem:

$this->byXPath( "//input[contains(@id, '_rule_1_display_times')]" )->value(8);

Any ideas what's wrong with getting current input text value?

1
  • I found out that it works via attribute method: $this->byXPath( "//input[contains(@id, '_rule_1_display_times')]" )->attribute('value'). But still the question persists what is wrong with ->value() Commented Apr 23, 2015 at 10:05

1 Answer 1

1

Value gives you the current value of the field vs attribute(value) that gives you the original value. It was asked here: Difference between Element.value and Element.getAttribute("value") So I'm guessing your current value is simply empty/not set.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.