Write values of each iteration to file

Ask general questions here.
riccardo
Posts: 30
Joined: Wed Apr 28, 2010 10:37 pm

Write values of each iteration to file

Post by riccardo » Tue May 10, 2011 11:23 am

I do have an iteration running, which generates a specific ID at the end of the testcase. Now I would like to write these ID's to a file as they will be used for further testcases.

I thought that would be easy possible using a StreamWriter and write them to a file. Opening the File is not a big Deal... I thought I could do this by using a Setup in the Testsuite, opening the file and generating the StreamWriter. Now the question is, how do I pass the StreamWriter to my Recording? and how can I pass the StreaWriter then to the Teardown Script which should close it?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Write values of each iteration to file

Post by Support Team » Tue May 10, 2011 5:41 pm

Hello,

in a recording you can put user code action between the other actions.
Make the StreamWriter a global object or create one that appends to the file in every user code action.

Regards,
Roland,
Ranorex Support Team

riccardo
Posts: 30
Joined: Wed Apr 28, 2010 10:37 pm

Re: Write values of each iteration to file

Post by riccardo » Fri May 13, 2011 4:35 pm

Thanks for your answer

I solved it by creating a document for each iteration...


Regards
Riccardo