Passing each row values as test variables for various tests from one single Excel sheet
Hi All,
I am wondering if below scenario is achieveable. Please let me know if this is an option.
In an excel sheet say I have below values
1st row | Value1 | value 2| Value 3|
2nd row| Value4 | value 5| Value 6|
3rd row | Value7 | value 8| Value 9|
I have below tests as
Test1
Test2
Test3
I want to pass 1st row values of excel sheet for only Test1 and 2nd row values for Test2 and so on.
How can I achieve this in KDT.
Thanks
If you know the number of tests that will be run, you can accomplish what you want using a combination of a Data Driven Loop and If..Then statements with 1 If..Then statement for each called test. I was able to write a simple KWT doing that. (See below.) If you run a different number of tests at different times, then you can include an If..Then statement as the first statement after the DataDriver Loop that looks to see if the TestNumber in the Excel file is a specific value, say 9999. If it finds that value, the script exits the data loop. So the logic is as follows:
Main Test
- DDT Loop
* If TestNumber = 9999 GoTo 'ExitLoop' Label
* If TestNumber = 1 Run KWT Test1
* If TestNumber = 2 Run KWT Test2
* If TestNumber = 3 Run KWT Test3
* etc.
Label ExitLoop
{end of test}