使用PHP和Codeception的Selenium webdriver测试在测试中停止,没有错误消息

时间:2013-08-22 13:58:57

标签: php selenium-webdriver codeception

我得到了这个测试:

<?php
$I = new WebGuy($scenario);
$I->wantTo('ensure that user can log in to Nova.');
$I->amOnPage('/'); 
$I->see('ABC');

// Login
$I->fillField("//input[@name='email']", "test@mail.com");  //<-- Test stops here!
$I->wait(1000);
$I->fillField("//input[@name='password']", "Apassword");
$I->click("//input[@name='save']");
$I->see("Test");
?>

测试执行填写电子邮件字段,然后停止。如果我使用电子邮件字段切换密码字段,则只在相应字段中输入密码,然后测试停止。代码看起来很好。有人有任何想法吗?

1 个答案:

答案 0 :(得分:0)

删除wait命令不会起作用,因为它甚至在到达wait命令之前就停止了。 仅仅为了测试目的,你试图使用:

 $I->wait(1000);

之前

$I->fillField("//input[@name='email']", "test@mail.com");  //<-- Test stops here!

或者它是否真的填写了电子邮件并且未能填写密码?

抱歉,我不能只回答&gt;&lt;