php - Selenium PHPUnit_Extensions_Selenium2TestCase_Element::fromResponseValue() -
i'm following examples book phpunit essentials zdenek machek , i'm on section functional tests using selenium.
i downloaded server, webdrivers , firefox ide.
the test class exported firefox ide:
class seleniumfirsttest extends phpunit_extensions_selenium2testcase { protected function setup() { $this->setbrowser('firefox'); $this->sethost('127.0.0.1'); $this->setport(4444); $this->setbrowserurl('https://www.google.com.br/'); } public function testcasephp() { $this->url("/?gws_rd=ssl"); $this->byid("lst-ib")->value("phpunit"); $this->bylinktext("documentation")->click(); $this->bylinktext("13. phpunit , selenium")->click(); $result = $this->bycssselector("h1.title")->text(); $this->assertequals("chapter 13. phpunit , selenium", $result); } }
when try run tests in netbeans following output:
"c:\bin\phpunit.bat" "--colors" "--log-junit" "c:\users\marcos~1.pra\appdata\local\temp\nb-phpunit-log.xml" "--configuration" "c:\webserver\apache 2.2\htdocs\databasetests\tests\phpunit.xml" "c:\program files\netbeans 8.0.2\php\phpunit\netbeanssuite.php" "--run=c:\webserver\apache 2.2\htdocs\databasetests\tests" phpunit 4.5.0 sebastian bergmann , contributors. configuration read c:\webserver\apache 2.2\htdocs\databasetests\tests\phpunit.xml e...... time: 25.44 seconds, memory: 5.75mb there 1 error: 1) seleniumfirsttest::testcasephp argument 1 passed phpunit_extensions_selenium2testcase_element::fromresponsevalue() must of type array, null given, called in c:\webserver\apache 2.2\htdocs\databasetests\vendor\phpunit\phpunit-selenium\phpunit\extensions\selenium2testcase\element\accessor.php on line 136 , defined c:\webserver\apache 2.2\htdocs\databasetests\tests\marco\test\functional\seleniumfirsttest.php:26 c:\webserver\apache 2.2\htdocs\databasetests\tests\marco\test\functional\seleniumfirsttest.php:26 c:\dev\phpunittest\vendor\phpunit\phpunit\src\textui\command.php:152 c:\dev\phpunittest\vendor\phpunit\phpunit\src\textui\command.php:104 failures! tests: 7, assertions: 14, errors: 1. generating code coverage report in html format ...teste done done.
i can't understand why test failing, considering passes when executed on firefox ide.
may me understand this?
thanks
Comments
Post a Comment