I am wondering if the following functional test is possible. I am working with PHPUnit_Extensions_SeleniumTestCase with Selenium-RC here, but the principle (I think) should apply everywhere.
Suppose I execute the following command for a specific div:
function testInput() {
$locator = $this->get_magic_locator();
$this->type( $locator, "Beatles" );
$this->verifyText( $locator, "Beatles" );
}
Conceptually, I believe this test should work. I enter data in a specific field and I just want to check that the text now exists as entered.
However, the results of my test (the assertion verifyTextfails) show that the content of the element is $locatorempty even after input.
There was 1 failure:
1) test::testInput
Failed asserting that <string:> matches PCRE pattern "/Beatles/".`
Has anyone else tried something like this? Should this work? Am I making a simple mistake?
Ryan source
share