cancel
Showing results for 
Search instead for 
Did you mean: 

Running bash command in ReadyAPI groovy steps

sam2009
Frequent Visitor

Running bash command in ReadyAPI groovy steps

Hello Team,

 

I have created a groovy step in my test case to execute the below bash command. When I try to run this command, then I get a below error from execution. I have tried the number of different things to make the bash command work but I didn't found any solution so far.

 

OS: mac 

bash command:

def process = "aws-azure-login".execute()
process.waitFor()
log.info "Output: " + process.text
log.info "Exit code: " + process.exitValue()

 

Error:

ERROR: An error occurred [Cannot run program "brew": error=2, No such file or directory], see error log for details

 

Also, just to make sure I have created 'bashCommand.groovy' class file in my visual studio and that is working fine but not sure why the same thing is not working in ReadyAPI groovy steps. So far I have noticed that when I pass any other command like the below examples then they are working fine.

 

Working bash cmd:

bash --version

java --version 

 

Can anyone please help me to understand what I am doing wrong?

 

Please note that my E2E test needed more than one bash command to run so I can't use '.sh' option because those commands needed to run in different intervals. 

 

Note: After installing ReadyAPI in my Mac machine, I have not added any additional files to the package folder (bin or ext). I hope that is not an issue.  

 

Please advise if you have anything suggestion for me to try?

Thanks

 

 

1 REPLY 1
nmrao
Community Hero

Re: Running bash command in ReadyAPI groovy steps

Please provide the absolute path of the "aws-azure-login" command in the blow
def process = "aws-azure-login".execute()


Regards,
Rao.
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors