1

In karate framework, while executing one test case, getting error

java.lang.RuntimeException: cannot convert, not a json string: [type: INPUT_STREAM, value: java.io.BufferedInputStream@5f8890c2] at com.intuit.karate.Script.toJsonDoc(Script.java:619) at com.intuit.karate.Script.assign(Script.java:586) at com.intuit.karate.Script.assignJson(Script.java:543) at com.intuit.karate.StepDefs.castToJson(StepDefs.java:329) at ✽.* json vExpectedJSONObject = vExpectedJSONFileContent,

Acually in this framework, we are executing sql query and then result of that query is stored at abc.json file. but due to this error that result is not getting stored in that json file.

I have tired with multiple option like file incoding - set to utf-8 then adding plugin in to pom.xml.

json vExpectedJSONObject = vExpectedJSONFileContent, I am expecting the sql result should be stored in json file.

4

1 回答 1

0

Finally got the solution:), Issue was related to framework setup, actually we are trying to call Runtime.getRuntime().exec funtion to execute our sql query by using command at cmd prompt. but due to some access privileges that command was not executing, so after debug, we have put that mysql.exe file into jre/bin folder and then it works....

于 2019-10-10T06:45:36.913 回答