I’m having trouble writing a for loop that would search for a specified value within a specified column of a database (shown below). The database is named ‘DM_Demo’ with ‘Column_Name’ as the specified column, and ‘ABC’ as the value to find. Essentially to run through the ‘Column_Name’ list and only run the command if a username is “ABC”.
TestData Demo_User = findTestData(“DM_Demo”)
for (def index : (0…Demo_User.verifyColumnName(“Column_Name”))) {
What i’d like to do is write a test case that would login only users with a username of ‘ABCUser’. The data is expandable so more of this user type can be added/removed.
How would i go about writing a script that would run logins for 'ABCUser’s only? Essentially looking through ‘Column 2’ for the ‘ABCUser’ and then running a login script for these users ignoring ‘DEFUser’?
Dom,
I got the scenario now. It will be easy if this test case is just a login test since we could use above script with an if checking for username. However, in more complicated situation where you need to call other test cases in the flow, for example:
- call testcase Login
- call testcase do something else (searching, verifying, etc).
then we do not have proper solution for it since we havent added filter ability to the DataFile yet.
I think some work-aroud solutions now are:
- combine all steps into single test case and then use above scripts to filter for logged in account.
- create temporary DataFile which contains only the account you wanna test.
I will put the filter ability to DataFile into our backlog for future release.