Hello,
I have create a scenario for which I need to select one data from test suite label and accordingly select the files inside it. for example:
testsuite
testcase ------------dataconn1 which (contains "abc","def" and "ijk" in each in each row)
testcase1--------dataconn2, dataconn3 and so on
"testcase1" is nested over "testcase". And testcase1 has the multiple data file which should attach to the testcase1 dynamically depeneds upon the data used in "testcase". If the data in "testcase" is "abc" then select the dataconn2 and "def" dataconn3 and so on.
As far as I know, It possible to select the data file dynamically for testcase is possible in ranorex but I don't know how to workaround.
Thanking you
Sujit Pandey
data driven testing select dynamidally datasource
Re: data driven testing select dynamidally datasource
Hi Pansujit,
Unfortunately it is not possible to add more than one data connector for each test case. But it is possible to create different data connectors and use them in your user code.
This would be a possible solution for you:
Getting access to the TestCase :
Getting access to a data connector in your code:
Assign Data Connector to the test case:
Just use those lines in your condition inside "testcase" asking for the current value of the data connector (e.a. "abc")
I hope I could help you with your problem.
Unfortunately it is not possible to add more than one data connector for each test case. But it is possible to create different data connectors and use them in your user code.
This would be a possible solution for you:
Getting access to the TestCase :
Code: Select all
var testCase1 = TestSuite.Current.GetTestCase("TestCase1");
Code: Select all
var testsource = DataSources.Get("dataconn1");
Code: Select all
testCase1.DataContext.Source=testsource;
I hope I could help you with your problem.
Re: data driven testing select dynamidally datasource
Hello,
Thank you qwertzu for your suggestion. I am going to use it and let you know the result.
Thanks a lot.
Sujit pandey
Thank you qwertzu for your suggestion. I am going to use it and let you know the result.
Thanks a lot.
Sujit pandey
Re: data driven testing select dynamidally datasource
Hello, I have tried the above given example but due to my programming in efficiency, I cannot succeed the problem. The scenario, I have create as follow:
testcase1 ---------------------------- datasource "abc" ------ this contains 10 rows
nested testcase11--------------------------- 10 data source but run only one data source depending upon content of datasource "abc"("def", "ijk"and etc).
nested testcase 2-----------------------------10 data source but run only one data source at a time.
for example: In the testcase1, if there is a row "english cheese" then in testcase11 the "def" should run.
In the testcase1, if there is a row "French fromage" then in testcase11 the "ijk" should run.
I have tried to solve, but I am failed. If someone have any idea, please provide me some examples, if possible.
Thanking you
Sincerely
Sujit Pandey
testcase1 ---------------------------- datasource "abc" ------ this contains 10 rows
nested testcase11--------------------------- 10 data source but run only one data source depending upon content of datasource "abc"("def", "ijk"and etc).
nested testcase 2-----------------------------10 data source but run only one data source at a time.
for example: In the testcase1, if there is a row "english cheese" then in testcase11 the "def" should run.
In the testcase1, if there is a row "French fromage" then in testcase11 the "ijk" should run.
I have tried to solve, but I am failed. If someone have any idea, please provide me some examples, if possible.
Thanking you
Sincerely
Sujit Pandey
Re: data driven testing select dynamidally datasource
Hi,
Check for example this post, where you can find a sample code describing how to set a nested data connector range, based of the value obtained from parent data connector...
http://www.ranorex.com/forum/looping-mo ... tml#p42114
Check for example this post, where you can find a sample code describing how to set a nested data connector range, based of the value obtained from parent data connector...
http://www.ranorex.com/forum/looping-mo ... tml#p42114
Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration