Forum Discussion

jkrolczy's avatar
jkrolczy
Regular Contributor
5 years ago

How to execute .bat successfully from a groovy script

SoapUI OS Users,

 

I have a .bat file that I need to run(excute) from a groovy script to mount an Azure File Share drive.

 

I have searched the internet and have seen so many folk trying to figure out what I am also asking.

 

How to execute .bat successfully from a groovy script is the question ?

 

I am using SoapUI 5.4.0 open source (run an an administrator)

 

Does anyone have a valid working example to follow.

 

This should not be such a hard action to achieve ???

 

Thanks

 

 

 

4 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    If mounting what you need to do, isn't it one time job?
    • jkrolczy's avatar
      jkrolczy
      Regular Contributor

      What I am trying to create out here is:

       

      From a Team City job, soapui is started on whatever build\test server - in this case something Win10 based because Azure mount only works from Win10 and not Win7.

       

      So Soapui starts up.,

      *** STEP I need: Groovy script executes .bat file to mount Azure file storage

      Test script runs to perform Request that will generate some files that are stored on Azure side
      Groovy script will copy over Azure storage files to local side

        -- again how to get execute() to work from Groovy script

      Groovy script to do some verification for what test case needs

      Groovy script to remove files\mount  (Optional depending on how the server acts when a Team City job is done)


      So mounting has to occur when SoapUI is executed whereever Team City directs it.

       

      So at this point is just trying to get Groovy script to actually execute something that works correctly

      and not some java error back or nothing happening at all.

       

      Manually the .bat to mount and unmount works

       

      So above is the general concept.