It is also know as "Structured Scripting" or "Functional Decomposition".
In this Framework,
- Test scripts are initially recorded by “Record & Playback” method.
- Common tasks inside the scripts are identified and grouped into Functions.
- These Functions are called by main test script called Driver in different ways to create test cases.
Advantages:
- Higher level of code reuse is achieved in Structured Scripting as compared to “Record & Playback”.
- The automation scripts are less costly to develop due to higher code re-use.
- Easier Script Maintenance(Common functionality need to modify at one place only).
Disadvantages:
- Technical expertise is necessary to write Scripts using Test Library Framework.
- More time is needed to plan and prepare test scripts.
- Test Data is hard coded within the scripts(data tables are not used).
Example:
Function for logging in to an application will look like:
Function Login()
Dialog("Login").WinEdit("Userame:").Set "Ankur"
Dialog("Login").WinEdit("Password:").Set "Password1"
Dialog("Login").WinButton("OK").Click
End Function
Now, we can call this function in the main script as follows
'Driver Script
Call Login()
Function Login()
Dialog("Login").WinEdit("Userame:").Set "Ankur"
Dialog("Login").WinEdit("Password:").Set "Password1"
Dialog("Login").WinButton("OK").Click
End Function
Now, we can call this function in the main script as follows
'Driver Script
Call Login()

No comments:
Post a Comment