【问题标题】:How to use I.attachFile in codeceptjs/protractor?如何在 codeceptjs/量角器中使用 I.attachFile?
【发布时间】:2018-10-08 00:29:41
【问题描述】:
I.attachFile('input[type=file]', 'test.txt');

我尝试在 codeceptjs/protractor 中使用 attachFile 函数。我得到这个错误。

TypeError: driver.execute 不是函数

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, 

【问题讨论】:

标签: selenium automated-tests codeceptjs


【解决方案1】:

试试I.attachFile('input[type=file]', 'lega-client/test.txt');

【讨论】:

  • 为什么要这样做?你能解释一下你的代码,以便其他人可以从中学习吗?
【解决方案2】:

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

I.attachFile('button','test.txt')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-07
    • 2015-10-01
    • 1970-01-01
    • 1970-01-01
    • 2020-03-04
    • 2020-07-14
    • 2016-02-06
    • 1970-01-01
    相关资源
    最近更新 更多