There's a new series on joecolantonio.com!
Announcing a new series: Learning to program using QTP! The series will cover learning to program using QuickTest Professional. Even though QTP is a functional testing tool, and HP (like most vendors,) tries to sell their tools as record and playback — what most will not tell you is that you'll still need to have some basic programming concepts under your belt.
Why can't I just record and playback a script?
First — I've never used a script that I simply recorded and played back for anything other than a quick demo. Simply put: record and playback is not reliable. This is mostly due to hard-coded values captured that may not necessarily work on playback. Also – there's always a need to add validation, verification, synchronization and additional flow- control logic to most scripts. Virtually all these changes require that an engineer have some knowledge of programming.
Eating your own dog food/ Why would I use QTP to Learn Programming?
Have you ever heard the slang “eating your own dog food“? It usually means that a company uses the products it has manufactured. So, you would assume that a company like HP would use its products (like QTP and LoadRunner) to test its own software.
I think this also applies to self-learning ; by utilizing the tools you already use in your job to expand your skills. QTP is perfect for learning programming, because it allows you to start small and use a tool that you are already using every day. Plus, you will be learning “on the job” about how to solve real-world problems.
What programming language does QTP use?
Tests in QuickTest Professional are coded using VBScript:
- VBScript is a programming language that was created by Microsoft as a scaled down version of the company's Visual Basic language.
- VBScript is also considered a scripting language like Perl, python and ruby. A scripting language's code is interpreted at run time instead of being compiled into an executable like Java or C#.
QTP's Expert View
To get started, you'll want to open up QTP and navigate to the Expert View from the View>Expert View menu option. The Expert view gives one the ability to begin entering VBScript code directly into QTP and running QTP — almost treating it like a computer.
QTP Debugging Features in the Expert View
Using the Expert View also allows one to use some of the basic built debugging features found in QTP like:
- Adding breakpoints
- Finding syntax issues
- Executing a script from any line within the test
- Stepping through a script line by line
- Keeping track of a variables run-time value
Don't worry if you aren't familiar with these operations. I plan to go into detail about them in a future post.
Are you with me?
Stay tuned for more posts/videos. I plan to increase or decrease the amount of posts I create for this series based on response. So by all means — let me know whether this series sucks or not.