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?

Bounce
  • 2,066
  • 6
  • 34
  • 65
  • 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() – Bounce Apr 23 '15 at 10:05

1 Answers1

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.

Community
  • 1
  • 1
ch3m
  • 24
  • 4