Forum Discussion

doubtsreadyapi's avatar
doubtsreadyapi
Contributor
4 years ago
Solved

How to pass arugments in python script from ReadApi

Hi

 

I am running a python script from readyAPi, where as python script have some arguments, like below, How to pass this arguments to python script from ReadyAPi

 

env =sys.argv[0] (Must pick the environment depending upon the environment we selected in readyAPi)
id = sys.argv[1] 
json_path = sys.argv[2](Must pick the response of the previous request in readyapi)
save_file_path = sys.argv[3](Must pick the file path)

 

Is there a way we can acheive, Passing the arugments to python script from ReadyAPi?

 

 

 

 

 

 

7 Replies

    • nmrao's avatar
      nmrao
      Champion Level 3

      Question is neither related ReadyAPI nor groovy.

       

      Any ways, one could pass the arguments in the same way as it is called from the command line.

      • doubtsreadyapi's avatar
        doubtsreadyapi
        Contributor

        Hi nmrao 

         

        Thanks for the info.. This is related to the ReadyAPi, from Ready APi i am able to run the python script, where as the python script contains some arguments, so for those arguments i have to pass the values from readyApi,  So this can be achieved from Command line arguments? 

         

        So the below argument values can be passed through command line, Please suggest.

         

        env =sys.argv[0] (Must pick the environment depending upon the environment we selected in readyAPi)
        id = sys.argv[1] 
        json_path = sys.argv[2](Must pick the response of the previous request in readyapi)
        save_file_path = sys.argv[3](Must pick the file path)