Keyword Driven Testing
Keyword Driven Testing
Agenda
Some information about testing in general Install Winrunner Install Engine Learn how to write scripts Break Write some scripts Solve Problems and discover solutions Questions
Reusability
Standard components are handled the same Common screens are handled with the same test tables. Test tables can be used in many different applications instead of creating one for each application.
Advantages of a Framework
Using a framework will actually give you more time. Shared test among projects that dont seem to have anything to do with each other. Mundane task no longer need be manual. Computers dont forget to do something once they are told once. Boring task are automated. You look like a hero for finishing on time!!!
Installing WRAFS
1. 2. Backup any prior installs and uninstall Install Java Virtual Machine (JVM) from http://java.sun.com/j2se/ 3. Run the WRSAFS Install 4. Install SAFS by running Setup.vbs 5. Scripts are installed to C:\WRSAFS 6. Test Tables are installed to C:\Datapool 7. Services are installed to C:\SAFS 8. STAF is installed to C:\STAF 9. Verify c:\staf; c:\safs;c:\staf\bin are added to the path 10. Verify Classpath additions have been made for STAF and SAFS jar files 11. Verify registry entries have been made and are pointed to the correct directories
Suite Driver
Intermediate scripts, calls Step Drivers .STD Extension
Step Driver
This is where all your work happens. .SDD Extension
Other Settings
Start Scripting!!!
Keep It Simple Silly (KISS)
Cycle Driver
Flight.CDD
T; LaunchApp T; Flights
Start Scripting!!!
Keep It Simple Silly (KISS)
Suite Driver
LaunchApp.STD
T; LaunchFlight T; login
Start Scripting!!!
Keep It Simple Silly (KISS)
Suite Driver
Flights.STD
T AddFlight
Start Scripting!!!
Keep It Simple Silly (KISS)
Step Driver
LaunchApp.SDD
C; SetApplicationMap; c:\Datapool\FlightReservation.gui C;LaunchApplication;TestApp;^FlightApp
Start Scripting!!!
Keep It Simple Silly (KISS)
Step Driver
Login.SDD
C; SetApplicationMap; C:\Datapool\FlightReservation.gui T;Login; AgentsName; SetTextValue; jdoe T; Login; Password; SetUnverifiedTextValue; mercury T; Login; OK; Click
Start Scripting!!!
Keep It Simple Silly (KISS)
Step Driver
AddFlight.SDD
T; FlightReservation; NewFlight; Click T; FlightReservation; Departures; SelectTextItem; "Los Angeles T; FlightReservation; Destinations; SelectTextItem; "Portland" T; FlightReservation; Flights; Click T; FlightsTable; OK; Click T; FlightReservation; CustomerName; SetTextValue; "Sue Smith" T; FlightReservation; FirstClass; Click T; FlightReservation; TicketsOrdered; SetTextValue; "2" T; FlightReservation; InsertOrder; Click
What Next???
Make it reusable so we can use the same script over and over Make the information generic Parameterize names or variables so they can change values
How do I do that?
StartApplication.STD
T; LaunchApp T; Login; ^UserName=jdoe; Password=mercury T; ExitApp T; Logoff T; Login; ^UserName=ssmith; Password=InvalidPassword T; VerifyInvalidPassword T; Login; ^UserName=bjones; Password = Mercury
Login.SDD
C; SetApplicationMap; C:\Datapool\FlightReservation.gui T;Login; AgentsName; SetTextValue; ^UserName T; Login; Password; SetUnverifiedTextValue; ^Password T; Login; OK; Click
ExitApp.SDD
C; SetApplicationMap; C:\Datapool\FlightReservation.gui T, FlightReservation, FlightReservation, SELECTMENUITEM, File;Exit
VerifyInvalidPassword.SDD
C; SetApplicationMap; C:\Datapool\FlightReservation.gui T; InvalidPassword; InvalidPassword; VerifyProperty; Visible; 1 T; InvalidPassword; OK; Click
Your Turn!!!
http://safsdev.sourceforge.net/sqabasic2000/RRAFSReference.htm
Flight.CDD Revisted
T; LaunchApp T; Flights
LaunchApp.STD
T; LaunchFlight T; login; ^user.name="jcrunk; ^user.password="mercury"
Flights.STD
C; SetVariableValues; ^Class="FirstClass; ^NbrTickets="2" T; AddFlight; ^Departure="Los Angeles; ^Destinations="Portland; ^Customer="Sue Smith" C; SetVariableValues; ^Class="BusinessClass; ^NbrTickets="3 T; AddFlight; ^Departure="Denver; ^Destinations="Los Angeles; ^Customer="John Doe" C; SetVariableValues; ^Class="EconomyClass; ^NbrTickets="1" T; AddFlight; ^Departure="Portland; ^Destinations="Seattle; ^Customer="Bob Jones" T; FindFlight; ^Customer="Sue Smith" T; UpdateFlight; ^NbrTickets="1; ^Class="BusinessClass" T; FindFlight; ^Customer="John Doe" T; UpdateFlight; ^NbrTickets="2; ^Class="EconomyClass" T; FindFlight; ^Customer="Bob Jones" T; UpdateFlight; ^NbrTickets="3; ^Class="FirstClass" T; FindFlight; ^Customer="Sue Smith" T; DeleteFlight T; FindFlight; ^Customer="John Doe" T; DeleteFlight T; FindFlight; ^Customer="Bob Jones" T; DeleteFlight
AddFlight.SDD
T; FlightReservation; FlightReservation; SelectMenuItem; File; New Order T; FlightReservation; Departures; SelectTextItem; Denver T; FlightReservation; Destinations; SelectTextItem; Portland T; FlightReservation; Flights; Click T; FlightsTable; AvailiableFlights; SetSelectedRow; 2 T; FlightsTable; OK; Click T; FlightReservation; CustomerName; SetTextValue; ^Customer T; FlightReservation; ^Class; Click T; FlightREservation; InsertOrder; Click
LaunchFlight.SDD
C; LaunchApplication; Flight; ^FlightApp; ^FlightPath
Login.SDD
T; Login; AgentsName; SetTextValue; ^user.name T; Login; Password; SetUnverifiedTextValue; ^user.password T; Login; OK; Click
AddFlight.SDD
T; FlightReservation; NewFlight; Click T; FlightReservation; Departures; SelectTextItem; ^Departure T; FlightReservation; Destinations; SelectTextItem; ^Destinations T; FlightReservation; Flights; Click T; FlightsTable; OK; Click T; FlightReservation; CustomerName; SetTextValue; ^Customer T; FlightReservation; ^Class; Click T; FlightReservation; TicketsOrdered; SetTextValue; ^NbrTickets T; FlightReservation; InsertOrder; Click
FindFlight.SDD
T; FlightReservation; FlightReservation; SelectMenuItem; "File;Open Order..." T; FindOrder; ByCustName; Click T; FindOrder; CustomerName; SetTextValue; ^Customer T; FindOrder; OK; Click
UpdateFlight.SDD
T; FlightReservation; ^Class; Click T; FlightReservation; TicketsOrdered; SetTextValue; ^NbrTickets T; FlightReservation; UpdateOrder; Click
DeleteFlight.SDD
T; FlightReservation; DeleteOrder; Click T; ConfirmationMessage; Yes; Click
References
Nagle, C. Test automation frameworks; 1999 Kit, E. & Prince, S. "A Roadmap for Automating Software Testing" Tutorial presented at STAR99East Conference, Orlando, Florida, May 10, 1999. Hayes, L. "Establishing an Automated Testing Framework" Tutorial presented at STAR99East Conference, Orlando, Florida, May 11, 1999. Kit, E. "The Third Generation--Integrated Test Design and Automation" Guest presentation at STAR99East Conference, Orlando, Florida, May 12, 1999. Mosley, D. & Posey, B. Just Enough Software Test Automation New Jersey: Prentice Hall PTR, 2002. Wust, G. "A Model for Successful Software Testing Automation" Paper presented at STAR99East Conference, Orlando, Florida, May 12, 1999. Dustin, E. Automated Software Testing: Introduction, Management, and Performance. New York: Addison Wesley, 1999. Fewster & Graham Software Test Automation: Effective use of test execution tools New York: Addison Wesley, 1999. Dustin, E. "Automated Testing Lifecycle Methodology (ATLM)" Paper presented at STAR EAST 2000 Conference, Orlando, Florida, May 3, 2000.
References
Kit, E. & Buwalda, H. "Testing and Test Automation: Establishing Effective Architectures" Presentation at STAR EAST 2000 Conference, Orlando, Florida, May 4, 2000. Sweeney, M. "Automation Testing Using Visual Basic" Paper presented at STAR EAST 2000 Conference, Orlando, Florida, May 4, 2000. Buwalda, H. "Soap Opera Testing" Guest presentation at STAR EAST 2000 Conference, Orlando, Florida, May 5, 2000. Pollner, A. "Advanced Techniques in Test Automation" Paper presented at STAR EAST 2000 Conference, Orlando, Florida, May 5, 2000. Cem Kaner, http://www.kaner.com Zambelich, K. Totally Data-Driven Automated Testing 1998 http://www.sqa-test.com/w_paper1.html SQA Suite Users, Discussions and Archives, 1999-2000, http://www.dundee.net/sqa/ Nagle, C. Data Driven Test Automation: For Rational Robot V2000 1999-2000 DDE Doc Index