简体   繁体   English

无法执行空手道脚本()方法

[英]Unable to execute karate script() method

I am trying to migrate one of selenium test to karate, while doing this I am using script() method defined in documentation which is used in karate for evaluating the given string as JavaScript within the browser but I am getting this我正在尝试将 selenium 测试之一迁移到空手道,同时我正在使用文档中定义的 script() 方法,该方法在空手道中用于在浏览器中将给定字符串评估为 JavaScript 但我得到了这个

在此处输入图像描述

driver.executeScript("sauce:job-result=passed");

Also Sharing my feature file which getting failed:还共享我失败的功能文件:

在此处输入图像描述

Also Even I tried calling below statement in my script but still getting the same error此外,即使我尝试在我的脚本中调用以下语句,但仍然出现相同的错误

* script("console.log('hello world')")

I am using testImplementation("com.intuit.karate:karate-core:1.2.0.RC1") version with gatling我正在使用testImplementation("com.intuit.karate:karate-core:1.2.0.RC1")版本

First - try version 1.2.0.RC6 that has some fixes for the console.log() issue.首先 - 尝试版本 1.2.0.RC6,它对console.log()问题有一些修复。

I also must say that sauce:job-result=passed does not look like valid JavaScript to me.我还必须说sauce:job-result=passed passed 对我来说看起来不像有效的 JavaScript。 Please take some time to read the docs: https://github.com/karatelabs/karate/tree/master/karate-core#karate-vs-the-browser请花一些时间阅读文档: https://github.com/karatelabs/karate/tree/master/karate-core#karate-vs-the-browser

If still stuck, follow this process.如果仍然卡住,请遵循此过程。 That is the only way to replicate and for us to determine what fixes we need to make (if any): https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue这是复制的唯一方法,也是我们确定需要进行哪些修复(如果有)的唯一方法: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue

See this answer for ideas on how to troubleshoot things at your end: https://stackoverflow.com/a/71952132/143475请参阅此答案以了解有关如何在您这边进行故障排除的想法: https://stackoverflow.com/a/71952132/143475

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM