0

我有一个非常简单的脚本,我试图在 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
4

2 回答 2

0

看起来您发现了一个错误,它是 2017 年 12 月制造的。很快,就会修复。

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

于 2019-03-05T08:23:53.553 回答
0

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

于 2019-03-06T21:00:40.040 回答