Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/226.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用phantomJS的Codeception,使用real browser的fillField可以,但在运行Codeception时,它是KO_Php_Codeception - Fatal编程技术网

Php 使用phantomJS的Codeception,使用real browser的fillField可以,但在运行Codeception时,它是KO

Php 使用phantomJS的Codeception,使用real browser的fillField可以,但在运行Codeception时,它是KO,php,codeception,Php,Codeception,我是一个新概念的初学者。 从验收测试,我想填写和有效的登录表。 我用的是: public function loginSuccessfully(AcceptanceTester $I) { $I->amOnPage('/'); //the url is good $I->fillField("//input[@name='Email']","foo"); //error here, the selector does not match ... } 但是,当我通过xp

我是一个新概念的初学者。 从验收测试,我想填写和有效的登录表。 我用的是:

public function loginSuccessfully(AcceptanceTester $I)
{
  $I->amOnPage('/'); //the url is good
  $I->fillField("//input[@name='Email']","foo"); //error here, the selector does not match 
  ...
}
但是,当我通过xpath插件在真实浏览器中尝试选择器“//input[@name='Email']”时,选择器匹配

我的问题是:我想调试我的脚本,在调用fillfield之前如何获取页面的代码源。我在这里看到我可以使用“”,但是当我在函数中使用$I->getModule或$this->getModule时,会出现错误“getModule not found”

如何使用_savePageSource方法?
谢谢你

页面源文件难道不在文件夹
tests/output
中吗?当测试失败时,您应该在output dir中保存页面源文件(在发生特定错误时处于其状态)。也许您的页面尚未完全加载?