Bounce
Bounce

Reputation: 2095

PHPUnit Selenium2 Error on getting current input text value

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?

Upvotes: 0

Views: 329

Answers (1)

ch3m
ch3m

Reputation: 24

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.

Upvotes: 1

Related Questions