New Series: Learning to Program with QTP – Getting Started

PerfectoTopAd

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.

29 comments
Aviad - March 5, 2012

Good initiative. I am looking for quality QTP training for years. So far I had found that training on how to program with vb in qtp expert view works for me the best in a video tutorial mode.
When the lecture recorded his own screen , and share the vb code under the video, so i can give it a go by my self.
Something in this style:
http://www.youtube.com/user/QTPeLearn
But the biggest chalange for me , is the implementation, how to approach a probelm, how to analyse a web app, or a non gui/ data validation testing, and think how vb code can serve me here to automate the test case? should I use INSTR function or MID function? Where can I get an access into a bank of code blocks that can help me to navigate through my needs

Reply
    Joe Colantonio - March 5, 2012

    Aviad » Awesome feedback Aviad! I’ll try to meet your expectation. Cheers~Joe

    Reply
Navnath Patil - March 5, 2012

Hi Joe,

Will definitely follow this series keep posting.

Thanks,
Navnath Patil.

Reply
    Joe Colantonio - March 5, 2012

    Navnath Patil » Great – thanks Navnath!!

    Reply
Roshan - March 5, 2012

Thats so true, record and playback hardly works.
Awaiting next post!

Reply
David Gross - March 5, 2012

Look fwd to seeing more info from you. Have you used any of the frameworks that allow you to generate QTP code? We had one from an Indian Company that we’ve used but as it was proprietary and selling sw wasn’t there thing am now looking at TAO. Any other options that you know that are good?

Thanks…

Reply
    Joe Colantonio - March 5, 2012

    David Gross » Thanks David! I have not used any frameworks (expect ones I’ve created) to generate QTP code. Can you send me a link to TAO? Cheers~Joe

    Reply
Bill Emery - March 5, 2012

I have a group of testers that are functionals, not programmers. I was looking at HP ALM Suite as an easy tool for them to test a new web program. You have any comments on HP ALM Suite vs QTP. I know HP ALM Suite can save money.

Reply
    Joe Colantonio - March 5, 2012

    Bill Emery » Looks to me like QTP (now called Unified Functional Testing) is one of many product that make up HP’s Application Lifecycle Management Suite. Not sure how much is saved purchasing QTP standalone vs buying it as part of a bigger bundle.

    Reply
Slade Burroughs - March 5, 2012

Looking forward to this. I work with a small group of testers that uses most of the HP tool sets. In my two years with the team I have been focused on LoadRunner and load testing, but am wanting (needing) to start to branch out with QTP and want to lear more about it.

I follow your blog through the RSS feed and am glad that you continue to keep it updated and add content. I would definitely follow any QTP guidance you provided.

Thanks for sharing this and all of your other content with us!

Reply
    Joe Colantonio - March 6, 2012

    Slade Burroughs » Cool – thanks Slade! I hope you find the future posts helpful. I’m still trying to figure out what to cover so your feedback much appreciated. Cheers~Joe

    Reply
Israel Valencia - March 6, 2012

Hi Joe,

I think you definitely should continue with this initiative. I have been working with QTP for 6+ years and I love automation, from simple descriptive programming to strong run time libraries and automation frameworks. However, I recognize you are always learning new things and methodologies from others, and from the moment I found your site I have been visiting it often to find HP product news you don’t even easily find at their site. Great work.

Cheers!
Israel

Reply
    Joe Colantonio - March 7, 2012

    Israel Valencia » Hi Isreal – Awesome! I’m glad you find the site helpful – I really appreciate your feedback. Cheers~Joe

    Reply
Humayun - March 7, 2012

keep it up. I am on board

Reply
    Joe Colantonio - March 7, 2012

    Humayun » Cool – thanks Humayun! Let me know how your new job is.

    Reply
Ram - April 7, 2012

Hi Joe,
Can you post some HPO-M47 Exam questions for us. It would be very helpful for preparing QTP11 Exam

Reply
    Joe Colantonio - April 9, 2012

    Ram » Hi Ram – I would if I knew them :) Does anyone else know what type of questions are asked on this exam?

    Reply
Kirti - April 7, 2012

Hi Joe,

I have accidentally found your web site. I would say that you have put tremendous effort. I really liked the way u explained the QTP. I am looking for more videos to come.

I want to be learn qtp and do automation :) any suggestion?? I have seen people asking question what is your automation framework. I really would like to know what is framework and how do you setup QTP framework? I think in automation framework is the primary key.

Keep posted nice suggestions!!

Thanks,
Kirti.

Reply
    Joe Colantonio - April 9, 2012

    Kirti » Thanks Kirti! Glad you find the videos helpful. I will try to create a post/video about the QTP framework I created – thanks for the idea :)

    Reply
    Joe Colantonio - April 14, 2012

    Kirti » Hi Kirti i created a post QTP – What type of automation framework do you use? that explains the framework that I use. Let me know if you have any questions. Cheers~Joe

    Reply
Taran Vohra - April 12, 2012

i was searching for QTP content online and i found article’s posted by you are really helpful.

Thanks for sharing them and keep posting :)
great work man..!!

Reply
    Joe Colantonio - April 12, 2012

    Taran Vohra » Thanks Taran – Glad you find the site helpful!

    Reply
Gwen - April 12, 2012

Joe, I’m definitely interested. Please keep these coming!!

I particularly love the suggestion of using QTP to learn to program. In the past, I have treated learning these two technologies as two different learning paths, subsequently finding myself overwhelmed by the learning curves imposed by each, and never getting anywhere with EITHER. Approaching both QTP and VBScript at the same time (on the same learning path) — particularly if concepts are introduced simultaneously with the “how-tos”, is an excellent approach to learning. It’s results-oriented.

BTW, another personal challenge has always been figuring out the syntax of any language I’ve attempted to learn. Experienced programmers always assume that the new learner has some background in another language. So, the more you can clarify syntax (much like an English grammar text would), the BETTER for the wanna-be’s like me.

Thanks!!!

Reply
    Joe Colantonio - April 12, 2012

    Gwen » Thanks for the feedback Gwen! I’m still debating if each post in this series should have a video. Would you like to see videos for all the post?Cheers~Joe

    Reply
Carol - January 7, 2013

Hi Joe! I am VERY interested in your videos. Do you have any existing videos? Please send me the urls.
Great information on your site! Thanks so much! Carol

Reply
Ravi - March 5, 2013

Thanks for all the information you provide through this site, we all love it.We will definately follow new series..

Thanks
Ravi

Reply
Smart Sheets - May 13, 2013

Thanks for your Excellent initialization to start QTP from the basics.One kind suggestion is that,a training would be even more helpful if you can explain the upcomings information with simple examples and screenshots, so that it would help the concepts clearly.

Reply
Click here to add a comment

Leave a comment: