Selenium 如何在codeceptjs/量角器中使用I.attachFile?

Selenium 如何在codeceptjs/量角器中使用I.attachFile?,selenium,automated-tests,codeceptjs,Selenium,Automated Tests,Codeceptjs,我尝试在codeceptjs/量角器中使用attachFile函数。我明白了他的错误 TypeError:driver.execute不是函数 尝试使用I.attachFile('input[type=file],'lega client/test.txt')语法正确,但必须选择第一个参数中的按钮,而不是字段 chromeDriver:2.33 selenium-standalone:3.7.1 codeceptJS:1.0.3 "output": "./e2e/codeceptjs_tes

我尝试在codeceptjs/量角器中使用attachFile函数。我明白了他的错误

TypeError:driver.execute不是函数


尝试使用
I.attachFile('input[type=file],'lega client/test.txt')

语法正确,但必须选择第一个参数中的按钮,而不是字段

chromeDriver:2.33
selenium-standalone:3.7.1
codeceptJS:1.0.3

"output": "./e2e/codeceptjs_tests/reports",
"helpers": {
  "Protractor": {
    "url": "http://localhost:4200/",
    "driver": "hosted",
    "browser": "chrome",
    "rootElement": "body",
    "smartWait":5000, 

请读一读为什么会这样。考虑使用格式化的基于文本的HTML、代码试验和错误堆栈跟踪更新问题。您尝试过I.attachFile(“输入[type =文件]”、“/Test.txt”)吗?为何要这样做?你能解释你的代码以便其他人可以从中学习吗?
chromeDriver:2.33
selenium-standalone:3.7.1
codeceptJS:1.0.3

"output": "./e2e/codeceptjs_tests/reports",
"helpers": {
  "Protractor": {
    "url": "http://localhost:4200/",
    "driver": "hosted",
    "browser": "chrome",
    "rootElement": "body",
    "smartWait":5000, 
I.attachFile('button','test.txt')