refer https://stackoverflow.com/q/64363749/143475
would appreciate someone on windows debugging and fixing this - but able to confirm that mac / linux is ok with the fix
most likely this line is the problem: https://github.com/intuit/karate/blob/master/karate-core/src/main/java/com/intuit/karate/ScriptBindings.java#L108
@ptrthomas I would like to work on the fix if it's ok?
@Sudhish2607 yes go ahead
I tried to replicate the issue mentioned in StackOverflow. I believe it's not a bug!
It's happening because the command is being run on PowerShell instead of CMD.
Solution:
-Dkarate.config.dir=test/resources/ to `-Dkarate.config.dir`=test/resources/java -Dkarate.config.dir=test/resources/ -cp karate.jar com.intuit.karate.Mainjava `-Dkarate.config.dir`=test/resources/ -cp karate.jar com.intuit.karate.MainMore context over the issue:
PowerShell has a more standard rule to parse system-properties parameters which are different from CMD. In a PowerShell command, the parameter names always begin with a hyphen. The hyphen tells PowerShell that the item in the command is a parameter name.
Here, we are passing the parameter as -Dkarate.config.dir, PowerShell sights the parameter name-tag as -Dkarate and not -Dkarate.config.dir; hence the error.
@Sudhish2607 makes total sense. thank you so much for looking into this and for adding a good stack-overflow answer ! I will close this then.
cc @kirksl just for information, I didn't know about the back-ticks thing in powershell
@ptrthomas, PowerShell could be a trouble for setting up the plugin on VS. Should we add the VS-plugin installation instructions here?
@Sudhish2607 thanks, I just did that and linked to a page where is a lot of detail: https://github.com/intuit/karate/wiki/Karate-Robot-Windows-Install-Guide#install-visual-studio-code