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中保存页面源文件(在发生特定错误时处于其状态)。也许您的页面尚未完全加载?