codeceptjs - CodeceptJS locator.stringify 在使用 Appium 运行 codecept 时不是函数错误
问题描述
我有一个非常简单的脚本,我试图在 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
解决方案
看起来您发现了一个错误,它是 2017 年 12 月制造的。很快,就会修复。
作为解决方法,使用不同的定位器,而不仅仅是字符串“用户名”。例如 CSS、Xpath、Strict 定位器。
推荐阅读
- python - 使用复制将数据框子集为新的
- c++ - 通过类型别名从构造函数前向模板推导
- css - Choppy height CSSTransition 与多个项目反应
- google-api - Google Calendar API 返回每日限制错误
- excel-2013 - 比较日期作为条件的 COUNTIF 函数不起作用
- html - 如何在所有主流浏览器中制作透明文本
- css - 如何从 Google Material Design Library 中获取概述的评论图标?
- apache-spark - Spark 何时为 map() 分配分区给 worker?
- python-3.x - Discord Python:如何在发送 GIF 时提及用户
- javascript - 如何在 vue 上的 ajax 响应成功后显示模态?