Closed Mohitkrishna12 closed 1 year ago
Hi @Mohitkrishna12
thanks for this idea, I'm all in favor of flexibility
I think you can already achieve that logic inside karate-auth.js:
* def auth = { username: '', password: '', otherinfo: '' }
args
object you can do it inside karate-auth.js using karate.get("any karate property")
This works...
Let me know if this can solve your use case.
Thanks a lot @ivangsa karate.get("any karate property")
works fine as I expected it helps.
Hi @ivangsa ,
I think it would be great if it is possible to pass 'args' as a parameter directly in
call read('classpath:karate-auth.js') args
instead of passing it as 'args.auth'. So that in 'karate-auth.js' file we can write our own authentication logic with the help of other args. Like passing wrong access token based on the status code to get 404 error.(Code snippet taken from the auto generated file).