简体   繁体   中英

Karate: Integrating JSCH class with karate framework

My 95% of automation framework is in Karate which works pretty well. There are few functionalities where we need to check intermediate results which get displayed in application log(Not in Json Response). I wrote a shell script which verifies the application logs on a Linux machine after sending the requests manually from Postman. And I am calling this script using JSCH library from eclipse.

Is there any way by which I can just send the requests from Karate and then call my JSCH class for verification so that manual step of sending request can be avoided?

Thanks, Abhi

Looks like you are not aware that Karate has excellent Java interop?

Please read this: https://github.com/intuit/karate#calling-java

As a second option: you can call any OS command using karate.exec() and it will even return the process output as a string. I have seen teams return JSON this way and in Karate you can cast to JSON and use match and it works well.

* json data = karate.exec('path/to/batch.sh')

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