Ask a Question

run vba macro from groovy

twozedz
Occasional Contributor

run vba macro from groovy

Hi I have Soap UI pro at work and  i am wondering whether the following can be automated:

 

1) Submit a request in soapui pro. A response is successfully received. This step does'nt need to be automated. I will manually run this.

 

3) Run a vba macro from groovy. The macro's inputs are request and response files from step 1 and also 2 other excel files saved locally. 

 

2) Copy calculated data generated from macro back into soap ui and show it to the user in a nice looking report.

 

 

5 REPLIES 5
twozedz
Occasional Contributor

Re: run vba macro from groovy

sorry, this forum is a waste of time. i hardly get any response and when i do get a response it is worthless

 

at work i will make sure we dump soap ui for good. waste of money

MFagerlind
Staff

Re: run vba macro from groovy

Hello,

 

Sorry that you're disappointed, but asking a question in the forums is not the best way to get support.

 

If you have a SoapUI Pro license, you're entitled to support, so you should open a ticket with Customer care. They will help you, and if they can't they'll reach out to us, the developers.

 

Kind regards,

Manne, Ready! API developer

prashobkt
Contributor

Re: run vba macro from groovy

@twozedz

 

You can only run macro using DotNet application or VbScript.

To run a Macro create a DotNet or a VBscript application, invoke it through groovy script.

 

create an command line exe using Dotnet. 

=======Dot net code======

App = new Excel.ApplicationClass()

object oMissing = System.Reflection.Missing.Value;

WorkBook = App.Workbooks.Open(
"your path", oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing, oMissing, oMissing, oMissing,
oMissing, oMissing, oMissing
);

App.Run("MacroName", arg1, arg2 , arg3, arg4)

 

=====================================

 

Execute the exe using Groovy script.

 

Groovy:

 

def cmd = exePath

def process = "$cmd".execute();

 

process.waitFor();

 

 

 

/T3D
twozedz
Occasional Contributor

Re: run vba macro from groovy

thanks. finally get a response.

 

do you know how i can display worksheet results from macro in soap ui pro?

 

this is what i am trying to do:

 

1) submit request and receive response using soapui pro and save files to local drive - DONE

2)  using vba macros do some calculations using the request and response files. macro displays results in sheet in excel. DONE as you suggested i ran the step in groovy script. thank you for that!!!!!

 

3) now i need to see results of macro in sheet displayed in soap ui...  Not sure how to this.Any suggestions?? the results from macro in the excel sheet is nicely formatted and is in table format with proper headers. 

 

i will be doing the above for over 100 request files..so i need to be able to see the results in soap ui for each test request.

prashobkt
Contributor

Re: run vba macro from groovy

@twozedz

 

It will be better to  write a Groovy script for reading the file using Apache POI library (Already in Lib directory of SoapUI).

 

OR 

 

Incase of single value to be seen, change the return type of main in DotNet program and macro in excel to integer type.

 

You can get the return value using below groovy script.

 

def exitCode = process.exitValue();

/T3D
cancel
Showing results for 
Search instead for 
Did you mean: