It is important to keep in mind that SAFS supports a hierarchy of test execution of simple text files containing CSV test records. One test record per line. The examples below show the default comma (,) separator between test record fields, but other delimiters like TABs, etc.. are supported.
Test tables are generally named with the appropriate suffix for the desired test level as defined below:
Keep the above hierarchy in mind during the following discussion of Record Types.
In the topmost Cycle test tables, you specify your own application vocabulary for logical, high-level Test Suites to perform. You give those Test Suites meaningful, logical names and those become the file names for the Test Suites:
Hypothetical Test Cycle: Regression.CDD
T, Launch MyApp For Testing T, Test Reports Feature T, Test Print Feature T, Shutdown Testing |
At runtime, the above Cycle-level Test Records (T) tell the Driver to go look for, open, and process the appropriate Test Suite files:
"Launch MyApp For Testing.STD" "Test Reports Feature.STD" "Test Print Feature.STD" "Shutdown Testing.STD" |
Hypothetical Test Suite: Launch App For Testing.STD
T, Launch MyApp T, Login With Credentials,, ^UserID=^UserID1, ^Password=^Password1 T, Verify At Main Screen |
At runtime, the above Suite-level Test Records (T) tell the Driver to go look for, open, and process the appropriate Test Step files:
"Launch MyApp.SDD" "Login With Credentials.SDD" "Verify At Main Screen.SDD" |
Note how at the Cycle and Suite level you are defining a reusable test vocabulary that is nothing more than filenames. You are not writing any code, script, or algorithms to implement this vocabulary. The SAFS test execution Driver is already prepared to do this for you.
Also notice when we called "Login With Credentials" we added an empty(blank) field between the comma delimiters, and then expressions ^UserID=^UserID1 and ^Password=^Password1.
That empty(blank) field is where you could specify that "Login With Credentials" is NOT comma-delimited. If that empty field is not empty, then the Driver will assume whatever IS present there should be treated as the new CSV delimiter for "Login With Credentials".
After that, we placed ^UserID and ^Password expressions to assign which UserID and Password will be used for Login. At runtime the values of these will likely be pulled out of the App Map where ApplicationConstants are stored. Find out more about App Maps and ApplicationConstants as well as Test Design Guidelines for Reusability.
Hypothetical Test Step: Login With Credentials.SDD
T, Login, UserName, SetTextValue, ^UserID T, Login, Password, SetTextValue, ^Password T, Login, Submit , Click |
As we can see in the above example, the Component Function Test Records at the Test Step level are very different than those in Test Cycles and Test Suites. The links to SetTextValue and Click show that these records take a Window name, a Component in that window, the Action to perform, and any parameters used by that Action.
The Window and Component names are references to Window and Component items in the user-defined App Map. The available Actions for a given Component Type are described in the SAFS Quick Reference or the more detailed SAFS Keyword Reference.
C, SetApplicationMap, AppMap_ja.map C, StartWebBrowser, ^AppURL, ^AppID, ^Browser C, Pause, 10 |
The command is always the first field after the record type. The command is then followed by any parameters it might take. Driver Commands are the same and applicable at all test levels.
B, "Loop_Start" ... ...do lots of whatever you need here... C, OnGreaterThanGotoBlockID, "Loop_Exit", ^val1, ^val2 C, GotoBlockID, "Loop_Start" ... B, "Loop_Exit" |
S, StartWebBrowser, ^AppURL, ^AppID, ^Browser S, OnGreaterThanGotoBlockID, "Loop_Exit", ^val1, ^val2 |
The above 2 records will actually log something like seen below. They will also increment ALL active test counters with SKIPPED record counts.
*SKIPPED* StartWebBrowser *SKIPPED* OnGreaterThanGotoBlockID |
The ( TW ) record type follows the exact same format rules as the standard ( T ) test record above.
The ( TF ) record type follows the exact same format rules as the standard ( T ) test record above.
The ( CW ) record type follows the exact same format rules as the standard ( C ) command record above.
The ( CF ) record type follows the exact same format rules as the standard ( C ) command record above.
C, BreakPoints, ^doBreakPoints BP, "If in Debug Mode check the values of various variables and other assets." C, OnGreaterThanGotoBlockID, "Loop_Exit", ^val1, ^val2 |
E, GetTopLevelWindows |