If my test case uses "Simple Data Table" as data connector, and if the test case is scheduled to be executed using Windows Task Scheduler from Computer Management; then the test case runs through the end of test.
But, if I use Excel file as data connector, same test, and I did check the box "Include File in Test Suite", and schedule test to run as the one above, the test fails with the following error:
"Failed to get rows from data source: Could not find the 'C:\Windows\system32\testdata_file1.xlsx'."
Use xls as data connector problem
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Use xls as data connector problem
Hi,
Could it be that you forgot to add your projects output directory to the "Start in" textfield of your task?
Regards,
Markus
Could it be that you forgot to add your projects output directory to the "Start in" textfield of your task?
Regards,
Markus
-
- Posts: 77
- Joined: Wed Sep 26, 2012 8:15 pm
Re: Use xls as data connector problem
I never used that field and never change the setting of the task scheduler. The only difference is just changing from using Simple Data Table to Excel File.
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Use xls as data connector problem
Hello,
We tried to reproduce that issue, but in our case we didn't get the error message.
Could you please give us more information how you defined your excel data connector and how you are using the windows task scheduler?
Can you please tell us which version of Ranorex you are using and which operating system is installed?
Thank you!
Regards,
Bernhard
We tried to reproduce that issue, but in our case we didn't get the error message.
Could you please give us more information how you defined your excel data connector and how you are using the windows task scheduler?
Can you please tell us which version of Ranorex you are using and which operating system is installed?
Thank you!
Regards,
Bernhard
-
- Posts: 77
- Joined: Wed Sep 26, 2012 8:15 pm
Re: Use xls as data connector problem
System info: Windows 7 Professional, 32-bit OS
Ranorex: 3.3.0
At first I created excel file on Desktop, named testdata_file1.xlsx
1. Right-click on the test case, select Data Source
2. Select "Use Excel File..." from "New" picklist
3. For the "File Name" field, click on the button and browse to the "testdata_files.xlsx" on Desktop
4. Check the box "Include File in Test Suite"
5. Click "Apply" and then "Data Binding"
6. Select the test, right-click, and select "Run Selected Test Case" ==> The test runs successfully
7. Then I tried to run the test without using Ranorex Studio, I meant used Command Line. The test runs successfully
8. Finally, I tried to run the same test using Windows Scheduler, the test failed with error
9. However, I went back to Project1.rxtst and picked "Simple Data Table", created the table with same data as xlsx file; then start the test via Windows Scheduler, and did not modify anything for this task. ==> Test runs successfully
Within Task Scheduler's Edit Action window:
Action = Start a program
Program/script = "C:\Users\workstation\Documents\Ranorex\RanorexStudio Projects\Project1\Project1\bin\Debug\Project1.exe"
Add Arguments (Optional) = /tc:TestCase_1 /rf:C:\Users\workstation\Desktop\Logs\%S_%Y%M%D_%T.rxlog
Ranorex: 3.3.0
At first I created excel file on Desktop, named testdata_file1.xlsx
1. Right-click on the test case, select Data Source
2. Select "Use Excel File..." from "New" picklist
3. For the "File Name" field, click on the button and browse to the "testdata_files.xlsx" on Desktop
4. Check the box "Include File in Test Suite"
5. Click "Apply" and then "Data Binding"
6. Select the test, right-click, and select "Run Selected Test Case" ==> The test runs successfully
7. Then I tried to run the test without using Ranorex Studio, I meant used Command Line. The test runs successfully
8. Finally, I tried to run the same test using Windows Scheduler, the test failed with error
9. However, I went back to Project1.rxtst and picked "Simple Data Table", created the table with same data as xlsx file; then start the test via Windows Scheduler, and did not modify anything for this task. ==> Test runs successfully
Within Task Scheduler's Edit Action window:
Action = Start a program
Program/script = "C:\Users\workstation\Documents\Ranorex\RanorexStudio Projects\Project1\Project1\bin\Debug\Project1.exe"
Add Arguments (Optional) = /tc:TestCase_1 /rf:C:\Users\workstation\Desktop\Logs\%S_%Y%M%D_%T.rxlog
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Use xls as data connector problem
Hi,
I suppose the problem is because you forgot to copy the Excel file to "C:\Windows\system32" directory or because you forgot to specify the working directory.
You have to copy the excel to the mentioned directory or you have to specify the working directory (in the "Start in" text field of the task).
Ranorex searches for the Excel file in the directory where the executable is executed from (if you checked the "Copy File to Project" checkbox), and if there is no such file you will get the specific error message.
Regards,
Markus
I suppose the problem is because you forgot to copy the Excel file to "C:\Windows\system32" directory or because you forgot to specify the working directory.
You have to copy the excel to the mentioned directory or you have to specify the working directory (in the "Start in" text field of the task).
Ranorex searches for the Excel file in the directory where the executable is executed from (if you checked the "Copy File to Project" checkbox), and if there is no such file you will get the specific error message.
Regards,
Markus
-
- Posts: 77
- Joined: Wed Sep 26, 2012 8:15 pm
Re: Use xls as data connector problem
Meaning that I have add the following:
Start in (Optional) = ""C:\Users\workstation\Documents\Ranorex\RanorexStudio Projects\Project1\Project1\bin\Debug\"
Thanks
Start in (Optional) = ""C:\Users\workstation\Documents\Ranorex\RanorexStudio Projects\Project1\Project1\bin\Debug\"
Thanks
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
Re: Use xls as data connector problem
Hi,
If your Excel file is placed in this directory then yes (it should be placed there if you checked the "Copy File to Project" checkbox).
Regards,
Markus
If your Excel file is placed in this directory then yes (it should be placed there if you checked the "Copy File to Project" checkbox).
Regards,
Markus
-
- Posts: 77
- Joined: Wed Sep 26, 2012 8:15 pm
Re: Use xls as data connector problem
That works.
Thanks
Thanks