Andrew
Andrew

Reputation: 238667

Selenium: How to assert that a text field is disabled?

I am using the PHPUnit Selenium Extension for Selenium RC.

I am able to assert the field is present:

$this->assertElementPresent('Date');

But how do I assert that the field is disabled (or not editable)?

Upvotes: 2

Views: 3887

Answers (1)

Andrew
Andrew

Reputation: 238667

isEditable() will return true/false

$this->assertEquals(false, $this->isEditable('Date'));

...or better yet:

$this->assertNotEditable('Date');

Upvotes: 1

Related Questions