keyword driven testing using wrsafs l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Keyword Driven Testing Using WRSAFS PowerPoint Presentation
Download Presentation
Keyword Driven Testing Using WRSAFS

Loading in 2 Seconds...

play fullscreen
1 / 48

Keyword Driven Testing Using WRSAFS - PowerPoint PPT Presentation


  • 159 Views
  • Uploaded on

Keyword Driven Testing Using WRSAFS. By John Crunk. 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. Keyword Driven Testing. Action Word Testing

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Keyword Driven Testing Using WRSAFS' - elias


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
agenda
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
keyword driven testing
Keyword Driven Testing
  • Action Word Testing
  • Data-Driven Testing
  • Keyword Driven Testing
  • It’s all the same thing, a specific set of actions happen for a given word.
why use keyword testing
Why use Keyword Testing
  • Reusability!!!
  • Common components handled by standard libraries
  • The details of the scripts are hidden from the user.
  • Users don’t have to learn the script language to write scripts.
reusability
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.
what can i test with a framework
What can I test with a Framework?
  • Web based applications
  • Java based applications
  • Windows based applications
  • C/C++/C# Applications
  • VB Applications
  • .NET Applications
  • COM (with enhancements)
  • Oracle (with enhancements)
  • Delphi (with enhancements)
looking beyond the project
Looking… Beyond “The Project”
  • Is your automated test effort really unique?
  • Do you really think your problems are novel?
  • Do you really want to do this all over again?

Generally, a finite set of common components make up our infinite set of unique applications.

We are all trying to solve the same problems!

Carl Nagle SAS

i don t have time to learn something new
I don’t have time to learn something new!!!
  • There is to much to do
  • Time lines are fast approaching
  • I can’t add to my already cramped workload.
  • Aren’t you telling me I am going to have to do more?
advantages of a framework
Advantages of a Framework
  • Using a framework will actually give you more time.
  • Shared test among projects that don’t seem to have anything to do with each other.
  • Mundane task no longer need be manual.
  • Computers don’t forget to do something once they are told once.
  • Boring task are automated.
  • You look like a hero for finishing on time!!!
installing wrafs
Installing WRAFS
  • Backup any prior installs and uninstall
  • Install Java Virtual Machine (JVM) from http://java.sun.com/j2se/
  • Run the WRSAFS Install
  • Install SAFS by running Setup.vbs
  • Scripts are installed to C:\WRSAFS
  • Test Tables are installed to C:\Datapool
  • Services are installed to C:\SAFS
  • STAF is installed to C:\STAF
  • Verify c:\staf; c:\safs;c:\staf\bin are added to the path
  • Verify Classpath additions have been made for STAF and SAFS jar files
  • Verify registry entries have been made and are pointed to the correct directories
getting down to business with wrafs
Getting down to business with WRAFS!!!
  • Cycle Driver
    • The main script calls Suite Drivers
    • .CDD extension
  • Suite Driver
    • Intermediate scripts, calls Step Drivers
    • .STD Extension
  • Step Driver
    • This is where all your work happens.
    • .SDD Extension
some file structure information
Some File Structure Information
  • Datapool
    • Bench
    • Cycle
    • Dif
    • Logs
    • Step
    • Suite
    • Taborder
    • Test
other settings continued
Other Settings Continued…
  • ;Note: the section name and the Key should not be changed
  • [STAF]
  • ENABLED = TRUE
  • [LOGMODE]
  • ConsoleLOg = TRUE
  • SQALog = TRUE
  • TextLog = TRUE
  • STAFLog = TRUE
  • [SAFSLOGS]
  • JarFile = C:\safs\lib\safslogs.jar
  • Machine = local
  • TextLog = TRUE
  • XMLLog = FALSE
  • ;Directory = S:\test\others\datapool\log
  • ;LogFacility = mylog
  • [SAFSVARS]
  • JarFile = C:\safs\lib\safsvars.jar
  • [SAFSMAPS]
  • JarFile = C:\safs\lib\safsmaps.jar
  • [DIFFER]
  • TOOL_EXE=C:\Documents and Settings\jcrunk\Desktop\UnxUtils\usr\local\wbin\DIFF.EXE
  • TOOL_OPTIONS="/t"
  • TOOL_BINARY_OPTIONS="--binary -s"
  • [DIFFVIEWER]
  • TOOL_EXE=C:\ExamDiff\ExamDiff.exe
  • TOOL_OPTIONS=" "
what does a command look like
What does a command look like?
  • T; Login; Login; Click
  • T; Login; Username; SetTextValue; “jdoe”
  • T; Login; Password; SetUnverifiedTestValue, “password”
welcome to the application map file
Welcome to the Application Map File

[ApplicationConstants]

FlightApp="C:\Program Files\Mercury Interactive\WinRunner\samples\vb\app\fltvb41a.exe“

[Login]

Login={class: "window", label: "Login", MSW_class: "ThunderRT6FormDC"}

Help={class: "push_button", vb_name: "cmdHelp"}

Cancel={class: "push_button", vb_name: "cmdCancel"}

OK={class: "push_button", vb_name: "cmdOK"}

AgentsName={class: "edit", vb_name: "txtAgentsName"}

Password={class: "edit", vb_name: "txtPassword"}

[InvalidPassword]

InvalidPassword={class: "window", label: "Flight Reservation Message", MSW_class: "#32770"}

OK={class: "push_button", label: "OK"}

creating an application map
Creating an Application Map
  • Select Tools|GUI Map Editor in Winrunner
  • Open the Application to be tested
  • Click on Learn in the Map Editor
  • Select the Window of the Application
  • Answer Yes to the prompt
  • Navigate to the next screen to learn
  • Go to Step 3 until all application has been learned
  • Save the GUI Map File
  • Open and run ProcessMapFile Script
  • You Application Map file is saved at the same place as your GUI Map File with a similar name.
a little about variables
A little about Variables
  • Component Names
  • Window Names
  • Data Values
  • Others?
how to use variables
How to use Variables
  • Can be in the Map File or the Test Tables
  • In the test table variables are preceded by a ^ (carot sign)
  • When assigning a value, simple type ^var=“value” or ^var1=^var2
  • When using a variable just type in ^variable in the place you want to use it.
where do all these commands come from
Where do all these commands come from?
  • Coders that have something to add write generic code for the commands
  • Documentation is updated and the commands are tested for all to use.
  • Documentation is located at http://safsdev.sourceforge.net/sqabasic2000/RRAFSReference.htm
start scripting keep it simple silly kiss
Start Scripting!!!Keep It Simple Silly (KISS)

Cycle Driver

Flight.CDD

T; LaunchApp

T; Flights

start scripting keep it simple silly kiss23
Start Scripting!!!Keep It Simple Silly (KISS)

Suite Driver

LaunchApp.STD

T; LaunchFlight

T; login

start scripting keep it simple silly kiss24
Start Scripting!!!Keep It Simple Silly (KISS)

Suite Driver

Flights.STD

T AddFlight

start scripting keep it simple silly kiss25
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 kiss26
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 kiss27
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 did we just do
What did we just do???
  • Started the Application.
  • Verified the application started.
  • Set the Text Value of Agent name.
  • Verified we set the Text Value of Agent Name.
  • Verified the value we set to Agent name is what we sent to it.
  • Set the Text Value of Password.
  • Verified that we set the text value of password.
  • Clicked the Ok button.
  • Verified we clicked the OK button.
what next
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
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
ExitApp.SDD

C; SetApplicationMap; “C:\Datapool\FlightReservation.gui”

T, FlightReservation, FlightReservation, SELECTMENUITEM, “File;Exit”

verifyinvalidpassword sdd
VerifyInvalidPassword.SDD

C; SetApplicationMap; “C:\Datapool\FlightReservation.gui”

T; InvalidPassword; InvalidPassword; VerifyProperty; Visible; 1

T; InvalidPassword; OK; Click

what is different about this one
What is different about this one?
  • We do all of the things the first script did, but this time we do a lot more!
  • Added test tables for Exit and invalid user
  • Verify you can login with a valid user
  • Verify you can exit the application
  • Verify an invalid user can gain access to the system
  • Make a login test table that works for most any application that has a login. Just make sure the name is the same, in the application map files.
let s do some more
Let’s Do some more…
  • Launch Application
  • "C:\Program Files\Mercury Interactive\WinRunner\samples\vb\app\fltvb41b.exe“
  • "C:\Program Files\Mercury Interactive\WinRunner\samples\vb\app"
  • Create Reservation
  • Find Reservation
  • Update Reservation
  • Delete Reservation
your turn
Your Turn!!!

http://safsdev.sourceforge.net/sqabasic2000/RRAFSReference.htm

flight cdd revisted
Flight.CDD Revisted

T; LaunchApp

T; Flights

launchapp std
LaunchApp.STD

T; LaunchFlight

T; login; ^user.name="jcrunk“; ^user.password="mercury"

flights std
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
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
LaunchFlight.SDD

C; LaunchApplication; Flight; ^FlightApp; ^FlightPath

login sdd
Login.SDD

T; Login; AgentsName; SetTextValue; ^user.name

T; Login; Password; SetUnverifiedTextValue; ^user.password

T; Login; OK; Click

addflight sdd42
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
FindFlight.SDD

T; FlightReservation; FlightReservation; SelectMenuItem; "File;Open Order..."

T; FindOrder; ByCustName; Click

T; FindOrder; CustomerName; SetTextValue; ^Customer

T; FindOrder; OK; Click

updateflight sdd
UpdateFlight.SDD

T; FlightReservation; ^Class; Click

T; FlightReservation; TicketsOrdered; SetTextValue; ^NbrTickets

T; FlightReservation; UpdateOrder; Click

deleteflight sdd
DeleteFlight.SDD

T; FlightReservation; DeleteOrder; Click

T; ConfirmationMessage; Yes; Click

where to go from here
Where to go from here?
  • Start experimenting with other applications
  • Read some of the documentation on http://safsdev.sourceforge.net
  • Have Confidence…You can Do it!!!
references
References
  • Nagle, C. Test automation frameworks; 1999
  • Kit, E. & Prince, S. "A Roadmap for Automating Software Testing" Tutorial presented at STAR’99East Conference, Orlando, Florida, May 10, 1999.
  • Hayes, L. "Establishing an Automated Testing Framework" Tutorial presented at STAR’99East Conference, Orlando, Florida, May 11, 1999.
  • Kit, E. "The Third Generation--Integrated Test Design and Automation" Guest presentation at STAR’99East 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 STAR’99East 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.
references48
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-2000DDE Doc Index