Vinitha Edwin
Vinitha Edwin

Reputation: 93

How to call python file in a feature file of karate automation?

I need to call a .py file and pass an argument to one of the functions in it and have to match the result returned.

For instance: xyz.py

KarateXyz.feature

Upvotes: 1

Views: 1616

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58058

Yes, you can use karate.exec() to call any OS process. Whether python is installed is up to you. Refer https://github.com/intuit/karate#karate-exec

* def result = karate.exec('python foo.py bar')

For more details, refer: https://stackoverflow.com/a/64352676/143475

Upvotes: 1

Related Questions