Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
What you need to know to get started in Automation
Presented by
Jim Hazen
Introduction Jim Hazen
Veteran of the Software Testing Trenches
Experience in software testing, both commercial and consulting work.
Working with automation and tools since 1989.
Implemented Automation on DOS, OS/2, Windows and Web platforms.
Experience with various tools; including HP/Mercury, IBM/Rational, and other ‘scripting’ languages.
Agenda How Do I Learn How to do Test Automation
Programming Basics & Constructs
What is Scripting
Programming for Test Automation
Windows, Objects, API’s & Other Fun Things
Outside of the Comfort Zone
Resources to Tap Into
Summary
Q&A
When I Grow Up… I want to be a Test Automation Developer.
How do I learn how to Automate Testing?
The Vulcan Mind Meld??? Umm… I don’t think so.
Can’t learn it in your sleep.
Nope, not this way!
Doesn’t work either.
Automation is hard work
Learning automation can be frustrating
Sometimes you don’t know where to go
Sometimes you go where you don’t want to
Sometimes you just want to give up
You need to study
You need to do research
You need to do the work!
Programming Basics Programs are written by humans
It’s only as good as the person who wrote it
Programs need to be written in a ‘logical’ fashion
Need to perform a specific task or set of tasks
Programs need to be written with modularity and simplicity in mind
Don’t try to do it all in one big piece, break it down and solve it a piece at a time.
Programs need to be maintainable
Make sure you can come back in 6 months and know what is going on.
What is Scripting? It’s programming! It is creating a set of instructions
for the computer to execute.
It can include other instruction sources
External data files
It is created by a human
It needs to be built in a logical manner
It needs to be modular
It needs to be maintainable
It is only as good as the person who wrote it
Test Automation Programming It is NOT Record & Playback!
Just Shoot Me!!!
Programming for Test Automation It’s a different view and purpose for the program code. Creating ‘software’ to ‘test’ software
You need to understand basic programming methods.
You need to understand basic software design and construction methods.
You need to understand how to program for different types of technologies. GUI vs. Database vs. System vs. Web vs. Services vs. API
You need to understand how to program in different languages if needed. C#, Java, VBScript, Jscript, XML, SQL, etc.
Test Automation Programming Cont. You need to understand how to ‘hook’ the software under
test and interact with it, and at what level.
API, or Object, or Service, or Protocol, or Application code itself, etc.
You need to understand how your tool ‘interacts with’ the software under test, and what functions/methods you have available for use.
GUI Object ‘methods’ (functions)
Example: SwfWindow(“LoginForm").SwfEdit(“ID”).SET “Jim”
You need to understand how to “pick apart” the software and “drive it” programmatically.
Windows, Objects, API’s & Other Things For most GUI based software the User Interface is
comprised of “Windows” (Parent) & “Objects” (Children).
Objects can be Standard or Custom Class (tweaked by the developer).
Object types include: Push Buttons, Edit Fields, Radio Buttons, Check Boxes, Combo Boxes, Tree Views/List, etc.
For an Automation Programmer you need to understand what ‘object’ you are working with, how to work with it, and the different ways to work with it. A lot to know and remember. Not easy.
Windows, Objects, API’s & Other Things API’s, or Application Programming Interfaces, allow
automation to directly interact with the functionality in the program, or system
Multiple ways to interact: COM, DCOM, ODBC, Service Layer
Usually done locally on the test machine
Have to know what the interface is comprised of and how to hook into it.
COM – Component Object Model
ODBC – Open Database Connectivity
Windows, Objects, API’s & Other Things Protocols
Protocols are different layers of communication by programs. Sometimes you need to hook your automation to them to get things done.
An example is HTTP & web servers
Services Remotely running applications that can be accessed by
‘calling’ directly to them.
An example is WSDL & SOAP
Application Code Physically testing at the code level.
An example is xUnit & other test harnesses in code
Again… a lot to know! And you won’t learn it overnight.
Outside of the Comfort Zone Well then… where do I go to learn?
Depending on your learning mode you will need to start with basic programming concepts and a language.
Books, Whitepapers, Classes, and Google.
Learn constructs, syntax, and processes of the language.
Learn about modern software construction, especially the building blocks (i.e.; objects & their methods/properties).
Find a mentor who can help to guide you.
OJT is the reality of this type of work.
Outside of the Comfort Zone cont. I already know the basics, what next?
Start building “Utility Scripts” that will help you in test setup, data mining, and whatever else you need. Get some further practice and experience.
Look up the different “Frameworks” and study them. Push yourself to the next level.
Look into how you can expand into working with other tools. For example, a tool that has a command line interface.
Resources to Tap Into Books
Visual Basic for Testers (Mary Romero Sweeney)
Foundations of Programming (Karl Seguin)
Everyday Scripting with Ruby (Brian Marick)
The Pragmatic Programmer (Andrew Hunt & David Thomas)
Search Amazon.com !
Resources to Tap Into cont. Websites
The Scripting Guys - http://technet.microsoft.com/en-us/scriptcenter/dd901334
Software Test Scripting - http://www.compendiumdev.co.uk/essays/testscripting/testscripting.php
Guidelines for Scripting - http://www.psqtconference.com/2004east/tracks/Tuesday/GuidelinesforScriptingLanguagesPaper.pdf
Automated Testing Institute - http://www.automatedtestinginstitute.com/home/
Resources to Tap Into cont. Classes
ACC – Intro to Programming
Metro State – Intro to Programming for Visual Basic
Connected Testing – Scripting QTP
Touchstone Technology Training - Scripting QTP http://www.touchstonetechnologytraining.com/classes/
Online Classes
SkillSoft – www.skillsoft.com
Lynda.com – www.lynda.com
Others – just Google!
Summary Programming for Test Automation is not an easy thing to do.
You cannot learn it overnight. It takes time and effort.
Test Automation requires learning basic programming concepts and methods, but also more in-depth in other areas. It requires knowledge of basic software design.
Automation requires knowledge of both development and testing. You need to have good skills in both in order to succeed.
Developing automation scripts requires knowledge of other areas outside of the application itself. You will need to have a system wide view of what you are working with.
Q&A
Contact Info Jim Hazen
Company: (www.connectedtesting.com)
Company email: [email protected]
Home email: [email protected]
References 1) “How to Automate Testing: The Big Picture“, Keith Stobie & Mark Bergman,
1992.
2) “Software Test Automation”, Mark Fewster & Dorothy Graham, Addison-Wesley, 1999.
3) “Automated Software Testing”, Elfriede Dustin et al., Addison-Wesley, 1999.
4) “Implementing Automated Software Testing”, Elfriede Dustin et al., Addison-Wesley, 2009.
5) “Experiences of Test Automation”, Dorothy Graham & Mark Fewster, Addison-Wesley, 2012.
6) “Seven Steps to Test Automation Success”, Bret Pettichord, http://www.io.com/~wazmo/papers/seven_steps.html, 2001.
7) “Success with Test Automation”, Bret Pettichord, http://www.io.com/~wazmo/succpap.htm, 2001.
Thank you for attending this session.
Please fill out an evaluation form.