One loop to run different keyword tests for different test cases...
I have a data-driven loop spreadsheet that lists the KeywordTest Script names in row one, each script is a column. Then I have a row for each test case or loop with indicators that I would changed based on if I want to run that script for that loop or not. The spreadsheet is like so:
Customer Type | Global_Login | Add_Customer_Bus | Add_Customer_Person | Global_Logout |
Business | Y | Y | N/td> | Y |
Person | Y | N | Y/td> | Y |
Then in the keyword test, I have an if...then for each keyword test where if Variables.DPTestCaseRun("Global_Login") Equals "Y" then Run Keyword Test Global_Login. This is repeated for each column of keyword test names
If...Then | Variables.DPTestCaseRun("Global_Login") Equals "Y" |
Run Keyword Test | Global_Login |
If...Then | Variables.DPTestCaseRun("Add_Customer_Bus") Equals "Y" |
Run Keyword Test | Add_Customer_Bus |
If...Then | Variables.DPTestCaseRun("Add_Customer_Person") Equals "Y" |
Run Keyword Test | Add_Customer_Person |
If...Then | Variables.DPTestCaseRun("Global_Logout") Equals "Y" |
Run Keyword Test | Global_Logout |
I would like to have a script (Keyword or VB script) loop through one if...then statement for the above with feeding the name of the Keyword test as a variable or parameter, for the one I want to check the indicator for and call if it is Y. Any suggestions?
I got as far as saving the script names on a separate spreadsheet tab in one column and then creating a datapool with that name being feed as a variable into a script with the following code to call the script: "Call Eval("KeywordTests." + testCaseName + ".Run")", but I don't know how to feed in the name to tell it find the indicator for that particular column in the table above?
When I use the following code I get an error, Object doesn't support this property or method.?
If (KeywordTests.Sanity_Test_Run.Variables.DPTestCaseRun(testCaseName) = "Y") Then
Call Eval("KeywordTests." + testCaseName + ".Run")
End If