1

karate.exec(['python3', 'filename.py', 'arg']) is ignoring the argument

I have a secretkey declared in karate-config.js file and use the variable in all my feature files, but that is not accessible in filename.py(which is obvious). So, I am using

karate.exec(['python3', 'filename.py', secretkey]) 

where secretkey is an argument for a function in filename.py. The problem here is karate is ignoring the argument i.e., secretkey. I am trying to access it in filename.py as sys.argv[1] The result is IndexError: list index out of range; because karate is ignoring the argument DEBUG com.intuit.karate - command: [python3, Ingest-snapshot.py]

dpedagada
  • 21
  • 2
  • that sounds like a bug, so please follow this process: https://github.com/karatelabs/karate/wiki/How-to-Submit-an-Issue - also refer other answers: https://stackoverflow.com/a/73230200/143475 – Peter Thomas Nov 10 '22 at 07:27
  • My mistake, I was calling karate.exec('python3 filename.py') in Background. I think I should delete this question, It will be misleading. There is no issue with Karate. – dpedagada Nov 10 '22 at 11:32
  • glad you sorted it out, I'll mark as duplicate so it can be closed – Peter Thomas Nov 10 '22 at 12:20
  • 1
    Great, Thanks for the quick response though. – dpedagada Nov 10 '22 at 13:02

0 Answers0