Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/287.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/unit-testing/4.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 seeInField查找元素,而fillField不';t-编码接受_Php_Unit Testing_Acceptance Testing_Codeception - Fatal编程技术网

Php seeInField查找元素,而fillField不';t-编码接受

Php seeInField查找元素,而fillField不';t-编码接受,php,unit-testing,acceptance-testing,codeception,Php,Unit Testing,Acceptance Testing,Codeception,我对CodeCeption一无所知。我的身体里有下面的html <div><input type="text" name="content_id" id="contentId" maxlength="10" value="123"></div> 在CodeCeption验收测试中,我有一个下面的代码 `<?php $I = new AcceptanceTester($scenario); $I->wantTo('fillfield test

我对CodeCeption一无所知。我的身体里有下面的html

<div><input type="text" name="content_id" id="contentId" maxlength="10" value="123"></div>

在CodeCeption验收测试中,我有一个下面的代码

`<?php 
$I = new AcceptanceTester($scenario);
$I->wantTo('fillfield test');
$I->amOnPage('/');
$I->seeInField('#contentId', 123);
$I->fillField('#contentId', 222397);
?>`
``
参见内场测试成功通过,但菲尔菲尔德抛出错误

抱歉,我无法填写字段“#contentId”,222397
InvalidArgumentException:当前节点列表为空


这使我无法继续前进。帮我解决这个问题。

终于找到了我自己问题的答案。我使用PhpBrowser模块进行测试,它不允许用户填写表单之外的字段。他们在文件中提到的其他东西是

常见的PhpBrowser缺点:

  • 您只能单击具有有效URL的链接或表单提交 钮扣
  • 不能填写不在表单中的字段
  • 您无法处理JavaScript交互:模式窗口、日期选择器等

  • 您使用Codeception进行JS交互的解决方案是什么?谢谢。我试图在没有表单的情况下填充输入字段。