【问题标题】:CodeceptJS locator.stringify is not a function error while running codecept with AppiumCodeceptJS locator.stringify 在使用 Appium 运行 codecept 时不是函数错误
【发布时间】:2019-03-07 05:00:40
【问题描述】:

我有一个非常简单的脚本,我试图在 Appium 中使用“fillField”填充网站中的用户名字段,但我收到此错误“locator.stringify 不是函数”。我无法弄清楚是什么问题。任何帮助表示赞赏。这是详细的输出-

[1] Starting recording promises
    Emitted | suite.before ([object Object])
  test something
    Emitted | test.before ([object Object])
    Emitted | test.start ([object Object])
    Emitted | step.before (I am on page "https://xxxxxxxxx.com/#login")
    Emitted | step.after (I am on page "https://xxxxxxxxx.com/#login")
    Emitted | step.before (I wait 6)
    Emitted | step.after (I wait 6)
    Emitted | step.before (I fill field "username", "hello@world.com")
    Emitted | step.after (I fill field "username", "hello@world.com")
    Emitted | step.start (I am on page "https://xxxxxxx.com/#login")
    I am on page "https://xxxxxxxxxxx.com/#login"
    Emitted | step.passed (I am on page "https://xxxxxxx.com/#login")
    Emitted | step.finish (I am on page "https://xxxxxxxx.com/#login")
    Emitted | step.start (I wait 6)
    I wait 6
    Emitted | step.passed (I wait 6)
    Emitted | step.finish (I wait 6)
    Emitted | step.start (I fill field "username", "hello@world.com")
    I fill field "username", "hello@world.com"
    [1] Error | TypeError: locator.stringify is not a function
    Emitted | step.failed (I fill field "username", "hello@world.com")
    Emitted | step.finish (I fill field "username", "hello@world.com")
    [1] Error | TypeError: locator.stringify is not a function
    [1] Starting <teardown> session
    Emitted | test.failed ([object Object])
    Emitted | test.finish ([object Object])
    [1] <teardown> Stopping recording promises
 › <screenshotOnFail> Test failed, saving screenshot
 › Screenshot has been saved to /Users/qa-engg/Documents/codeceptJS/appium/output/test_something.failed.png
  ✖ FAILED in 9740ms

    [2] Starting recording promises
    Emitted | test.after ([object Object])
    Emitted | suite.after ([object Object])

-- FAILURES:

  1) IP mobile
       test something:
     locator.stringify is not a function

【问题讨论】:

  • 你能把你的配置传递给 Appium 助手吗?

标签: codeceptjs


【解决方案1】:

您似乎发现了一个 2017 年 12 月制造的错误。 很快,就会修复。

作为解决方法,使用不同的定位器,而不仅仅是字符串“用户名”。 例如 CSS、Xpath、Strict 定位器。

【讨论】:

  • @Karthik ,在 2.0.8 中修复
【解决方案2】:

@Evgeny - 感谢您的回复。我终于能够将问题归零到 webdriverio 的安装。我有全球和本地安装。我卸载了所有东西,然后进行了本地安装,似乎已经解决了这个问题。

【讨论】:

    猜你喜欢
    • 2020-07-26
    • 2018-02-03
    • 2018-04-05
    • 1970-01-01
    • 2020-12-24
    • 2021-10-19
    • 2019-12-09
    • 1970-01-01
    • 2021-10-14
    相关资源
    最近更新 更多