AIG_OneClaim_Su
12 years agoNew Contributor
Passing Dynamic Datasink
Hi,
We want to use Datasink to write the report into an excel sheet which will be created dynamically for each project run. The steps look as below:
1. Storing the result in a static Excel sheet. (Ex: C:/Users/abc/Desktop/abc.xls)
2. Creating the new excel sheet dynamically after each run using Groovy script.
(A code snippet: WritableWorkbook workbook = Workbook.createWorkbook(new File("path"+dateandtime+".xls")))
3. Adding a Property transfer step to fetch the path of the created script into "Test Case level property"
4. Transferring the path of the created Excel sheet into new Datasink (here we give something like "${#TestCase#Path}" in the browse field
Now our problem is SOAPUI searches for ${#TestCase#Path}, namely, Step 4 even before the excel has been created in Step 2. And we get the below error:
TestCase failed [java.lang.Exception: Failed to prepare testStep [DataSink Current result]; java.io.FileNotFoundException: C:\Users\abc\Desktop\Results-2014-02-12-15-14-20.xls (The system cannot find the file specified), time taken = 0
Could anyone help me on using the Datasink to write to a dynamically created Excel file.
We want to use Datasink to write the report into an excel sheet which will be created dynamically for each project run. The steps look as below:
1. Storing the result in a static Excel sheet. (Ex: C:/Users/abc/Desktop/abc.xls)
2. Creating the new excel sheet dynamically after each run using Groovy script.
(A code snippet: WritableWorkbook workbook = Workbook.createWorkbook(new File("path"+dateandtime+".xls")))
3. Adding a Property transfer step to fetch the path of the created script into "Test Case level property"
4. Transferring the path of the created Excel sheet into new Datasink (here we give something like "${#TestCase#Path}" in the browse field
Now our problem is SOAPUI searches for ${#TestCase#Path}, namely, Step 4 even before the excel has been created in Step 2. And we get the below error:
TestCase failed [java.lang.Exception: Failed to prepare testStep [DataSink Current result]; java.io.FileNotFoundException: C:\Users\abc\Desktop\Results-2014-02-12-15-14-20.xls (The system cannot find the file specified), time taken = 0
Could anyone help me on using the Datasink to write to a dynamically created Excel file.