通过Firefox进入空手道UI中的文本框中输入值后获得错误
此问题只有当我通过Firefox驱动程序调用脚本时,在输入文本框中的值后,出现错误和测试是错误
configure driver = {type:'geckodriver' , executable:'C:\Users\dinesh\Downloads\geckodriver-v0.31.0-win64\geckodriver.exe'}
driver 'https://courses.ultimateqa.com/users/sign_in'
screenshot()
driver.maximize()
input("//*[@id='user[email]']","[email protected]")
消息,
* input("//*[@id='user[first_name]']", 'welcome')
js failed:
>>>>
01: input("//*[@id='user[first_name]']", 'welcome')
<<<<
org.graalvm.polyglot.PolyglotException: Expected to find an object with property ['message'] in path $['value'] but found 'null'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.
- com.jayway.jsonpath.internal.path.PropertyPathToken.evaluate(PropertyPathToken.java:71)
- com.jayway.jsonpath.internal.path.PathToken.handleObjectProperty(PathToken.java:81)
- com.jayway.jsonpath.internal.path.PropertyPathToken.evaluate(PropertyPathToken.java:79)
- com.jayway.jsonpath.internal.path.RootPathToken.evaluate(RootPathToken.java:62)
- com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:99)
- com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:107)
- com.jayway.jsonpath.JsonPath.read(JsonPath.java:185)
请帮助我XPath是正确的,空手道是在文本框中写入值,但是之后是失败
This issue is only when I invoke the scripts via firefox driver, after entering value in a text box getting an error and test is failing
configure driver = {type:'geckodriver' , executable:'C:\Users\dinesh\Downloads\geckodriver-v0.31.0-win64\geckodriver.exe'}
driver 'https://courses.ultimateqa.com/users/sign_in'
screenshot()
driver.maximize()
input("//*[@id='user[email]']","[email protected]")
Error message
* input("//*[@id='user[first_name]']", 'welcome')
js failed:
>>>>
01: input("//*[@id='user[first_name]']", 'welcome')
<<<<
org.graalvm.polyglot.PolyglotException: Expected to find an object with property ['message'] in path $['value'] but found 'null'. This is not a json object according to the JsonProvider: 'com.jayway.jsonpath.spi.json.JsonSmartJsonProvider'.
- com.jayway.jsonpath.internal.path.PropertyPathToken.evaluate(PropertyPathToken.java:71)
- com.jayway.jsonpath.internal.path.PathToken.handleObjectProperty(PathToken.java:81)
- com.jayway.jsonpath.internal.path.PropertyPathToken.evaluate(PropertyPathToken.java:79)
- com.jayway.jsonpath.internal.path.RootPathToken.evaluate(RootPathToken.java:62)
- com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:99)
- com.jayway.jsonpath.internal.path.CompiledPath.evaluate(CompiledPath.java:107)
- com.jayway.jsonpath.JsonPath.read(JsonPath.java:185)
Please help me the xpath is right, karate is writing the value in text box but after that it is failing
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对我来说,这种代码都可以使用Chromedriver和Geckodriver。当然,这些可执行文件必须在路径环境变量中设置。
我还添加了
Waitfor
方法来等待Web元素。For me this code works, both with chromedriver and geckodriver. Of course these executables must be set in the PATH environment variable.
I added also the
waitFor
method to wait for the web element.