In V3.xx you have introduced data-driven mechanism . However ,i don't know whether i can update a simple data table and then save it . Next time this case is invoked again ,i want to use the stored data.
For instance,
1. In a test case , i created a simple data table with a row of data and a parameter "ABC" in databinding.
2. In run , i update the data and created a new parameter "BCD" by TestCase.Current.DataContext.SetParame("BCD","000");
3. I tried TestCase.Current.DataContext.Source.Store();
When the test case finished , On data binding, i found the updated data and the new parameter are not saved into test case.
If i can update/save , it will much simplify my work
Can i save data when test case finishs. V3.2.2
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Can i save data when test case finishs. V3.2.2
Hi,
Regards,
Peter
Ranorex Team
Do you want to store the new parameter directly into your test case (Test Suite file) or do you want to use the param just at runtime?marcushe wrote:When the test case finished , On data binding, i found the updated data and the new parameter are not saved into test case.
Regards,
Peter
Ranorex Team
Re: Can i save data when test case finishs. V3.2.2
I want to store the data into my test case(file) . Then after Windows restart ,i can continue from the break-point.Support Team wrote:Hi,
Do you want to store the new parameter directly into your test case (Test Suite file) or do you want to use the param just at runtime?marcushe wrote:When the test case finished , On data binding, i found the updated data and the new parameter are not saved into test case.
Regards,
Peter
Ranorex Team
And Any new params created at runtime could be saved .
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Can i save data when test case finishs. V3.2.2
Hi,
Please try the following code to save it back to the test suite file.
Peter
Ranorex Team
Please try the following code to save it back to the test suite file.
TestCase.Current.DataContext.SetParameter("yourParamName","yourValue"); var testSuite = TestSuite.Current as TestSuite; testSuite.FileName = testSuite.Name + ".rxtst"; testSuite.SaveToFile(null, false);Regards,
Peter
Ranorex Team
Re: Can i save data when test case finishs. V3.2.2
Hi,PeterSupport Team wrote:Hi,
Please try the following code to save it back to the test suite file.TestCase.Current.DataContext.SetParameter("yourParamName","yourValue"); var testSuite = TestSuite.Current as TestSuite; testSuite.FileName = testSuite.Name + ".rxtst"; testSuite.SaveToFile(null, false);Regards,
Peter
Ranorex Team
It works.
BTW,
However , i think you didn't mention that a copy .rxtst will be created at YourProject\debug\bin\ , as well as other data source file(like .csv).
At first i run at Studio , at the end i found the params were not updated in the *.rxtst in my Studio . It almost make me think you give a wrong example. Then at bin\, i found the params had been updated in the
.rxtst here.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Can i save data when test case finishs. V3.2.2
Hi,
I thought you need the bin directory rxtst, otherwise you have just to replace the correct path to your filename then this should work too.
Regards,
Peter
Ranorex Team
I thought you need the bin directory rxtst, otherwise you have just to replace the correct path to your filename then this should work too.
Regards,
Peter
Ranorex Team