简体   繁体   中英

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

在此处输入图像描述

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

First - try version 1.2.0.RC6 that has some fixes for the console.log() issue.

I also must say that sauce:job-result=passed does not look like valid JavaScript to me. Please take some time to read the docs: 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

See this answer for ideas on how to troubleshoot things at your end: https://stackoverflow.com/a/71952132/143475

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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