Contributions
writting output to Soapui screen
Dear all, I am new to SOAPUI & GROOVY Script, in fact I just picked up the book(groovy in action) recently. I would like to learn groovy scripting in conjunction with SOAPUI(4.0.1). I have gone through the intro chapter with “Hello world”. I have type the example code from the book directly into my SOAPUI script step, most of the script seem to work. However when I try the Fibonacci number example code; current = 1 next = 1 10.times { print current + ' ' newCurrent = next next = next + current current = newCurrent } println '' I can’t see any response (result) on my SoapUI screen. While the same set of code running on groovy console does works(ie, show the number sequence). The problems seem to be; the (println '') which is understood by Groovy console but not SOAPUI. This command seem to print the information onto the screen in the groovy console, but in soapui there may not be a console. Checking with google got me the answer of “writer.writer (xxxxx)”statement, but upon running the script. I get only error messages. Def current = 1 Def next = 1 Def a = 0 //10.times// While (a <= 10){ print current + ' ' newCurrent = next next = next + current current = newCurrent a++ } //println ''// //Writer.writer(current) //Write.close() The Question is. is there a SOAPUI equivalents to the “println” groovy command? Which will allow me to print the output in the soapui screen somewhere. Thank you for all your time and effort. Sincerely.24KViews1like1CommentRe: write jdbc data to text file.
Hi Tim, Thanks for the super quick response. (I didn’t expect an answer back on the same day.) I’ll definitely try out the your suggestion. I still have some questions. 1)I could retrieve data within my JDBC step. The statement “def myID = “12345” ”, it look as if I need to manually define this in my script step, is this correct? 2)I have created an output file at a location already. Do I still need to use the “def outputFile = new File("C:\\myValues.txt")”? or is this statement use to tell SOAPUI where my file is? Thanks again, I hope you don’t mind if I come back with more questions later. Sincerely.1.6KViews0likes0Commentswrite jdbc data to text file.
Dear All, Can anyone help me with my problem. I am currently using SOAPUI to test webservices (some of my services are Asynchro, while others are Synchro) and I am very new to SOAPUI. I have searched the forum with keyword like (JDBC, write, data, into, text file or combinations from these words.)and I am currently going through the forum page by page as well. System information: Windows7 (currently used and for office environment). Oracle SQL developer (2.1.0.63) SOAPUI (4.0.1) My problem is: (this is an Asynchro service – thus no response.) (precondition: all my inputs(properties) are set in a text file, which I declare on the project level.) -I use SOAPUI project to create a document. When this is done, the document is created and in the Oracle sql developer database the document is registered. -the database then assigns an ID number to this document. I am able to connect to the database with SOAPUI(with JDBC Request) and I’ve been able to query the information within SOAPUI with sql_statement. -but this ID number is needed in my next TestStep. *Here is the heart of the issue: - I would like to write this ID number from my Oracle sql developer(database/table) or from SOAPUI-JDBC Request into my text file(properties files). -Or can this be done with “Property Transfers” if so how?(since I am transferring properties from a JDBC request and not a normal output <response>) 1)What are the Pre-Steps(ie, what do I need to install and/or what preparations is needed, before I start thinking about writing the data to my text file(properties sheet). ) 2)what are the steps and/or codes that are needed to write the data from JDBC Request or Oracle sql Developer into my text file. I have seen example where the code (groovy script) can read information from a .csv and/or .txt but my problem seem to be the other way around, I need to write data to a text from SOAPUI(JDBC Request) or Oracle sql Developer. Can someone please help with this problem, or direct me to link(s) where I can find these information. Thank you, to all for their assistance and any help will be greatly appreciated. Sincerely.2.2KViews0likes2Comments