我想填写表格并提交。
检查我的脚本的一部分:
casper.then(function(){
if(this.exists('#msisdn')){
this.echo('ok found');
**this.test.assertExists('form[id="internetPlus"]', 'form is found');
this.fill('form[id="internetPlus"]', {
'numero': 'xxxxxxxx'
},true);**
this.click('#button');
我得到了这个错误:
**PASS form is found**
[info] [remote] attempting to fetch form element from selector:
'form[id="internetPlus"]'
**[error] [remote] TypeError: 'undefined' is not an object (evaluating
'field.getAttribute')
FAIL CasperError: Unable to fill form
# type: uncaughtError
# error: "CasperError: Unable to fill form"
CasperError: Unable to fill form
/home/soufyan/workspace/casperjs:524 in fill
/home/soufyan/workspace/casperjs/kkostoreHomeTest.js:45
/home/soufyan/workspace/casperjs:909 in runStep
/home/soufyan/workspace/casperjs:252 in checkStep**
我不明白为什么我无法填写表格,因为断言结果是好的。