Relevant Codes (by Anshoo Arora)

A Test Development Resource for HP QuickTest Professional.

Anshoo Arora

Review of And I Thought I Knew QTP – a technical novel by Tarun Lalwani. Anshoo Arora (yours truly) had the opportunity to work on this project as the Technical Editor & Reviewer. 3 free copies will be given away to the lucky winners signed by both Tarun and I.

{ 98 comments }

Updates

by Anshoo Arora on August 3, 2011

UI Changes To begin with, if you’re a regular reader here you will notice that there have been some changes to the post design here. I received an email from a reader who brought the site contrast to my attention which caused difficulty when reading for a long time. Well, the old contract for all [...]

{ 3 comments }

I have been researching this topic for a very long time and I finally have a workaround which I have tested for for the last 2 months with great success. The best part about this workaround is, I just need to create wrappers, without including any of the code I have in my QTP function libraries. If I add a new method to my class, all I do to update the Intellisense is add the method (without the QTP code) in my VB lib, create a DLL and Register the library for COM Interop.

{ 24 comments }

This article shows a simple way of finding out in which cell a QTP’s Test Object resides.

{ 48 comments }

Over the past few years, I have read numerous threads and posts talking about working with Excel using VBScript. Not only have there been numerous threads, but also frameworks that use Excel as the input and/or driver engine. I wanted to work on this mini-project for a long time, and I finally have Version 1.0 of ExcelUtil ready for download! It comes with .CHM documentation.

{ 28 comments }

Over the past few weeks, I have been actively working on Quality Center (ALM) and its integration with QuickTest Professional. One of the mini-projects I’ve worked on is creating a custom object that executes a test set and sends an email to the supplied distribution list from ALM TestSet’s Automation tab. VBScript code available for download.

{ 18 comments }

This tip shows how to disable the Error message: “A script on this page is causing Internet Explorer to run slowly” with using VBScript.

{ 10 comments }

CreationTime

by Anshoo Arora on September 3, 2010

This article explains how the Browser’s CreationTime ordinal identifier works in QTP with examples.

{ 19 comments }

VBScript’s error handling techniques have been quite limited to On Error statements, and even though they satisfy our needs to some extent, the lack of incorporating dynamic behavior with them has been a much bigger issue. In this article, I will implement a Try-Catch-Finally statement with QTP’s GUI objects along with an On Error statement. This will enable dynamic behavior and enable us to easily divide flow depending on different error conditions.

{ 3 comments }

Updates

by Anshoo Arora on July 22, 2010

I know and you may have realized that there haven’t been any new article or updates here for the last few weeks. I have been extremely busy with prior obligations, work and a few big projects outside of work that I have been engaged in. However, please be assured that there are some articles on the way and another demo framework over the next few days. Please click the topic to continue reading..

{ 25 comments }

There is a common perception that we must include the Browser object in hierarchies when working in the Web environment. The truth is that, we really don’t need to include the Browser object if the Page object has been included in the hierarchy.

{ 30 comments }

This topic covers the concepts of the Eval function and Execute statement in depth. The function Eval is used to evaluate a string and return the result of the string expression. The Execute statement on the other hand, executes one or more statements in a string expression and enables creation of dynamic code. Multiple statements can be executed at once by using colons or line breaks to separate them.

{ 43 comments }

This post describes a few ways to use Regular Expressions to select the target item from List objects. All examples of this post demonstrate techniques to be used in Web Applications, but they can be easily extended to technologies that store all list items with delimiters.

{ 27 comments }

This post shows a quick and easy way to compare 2 Excel files. I know there are several code snippets on the inter-webs that show how to compare 2 Excel files, but what makes this technique different is performance. I know faster techniques are possible, but after much experiment, this was the one that continuously worked at the best speed in comparison to other methods.

{ 75 comments }

The previous articles written for the Siebel category were written from a perspective of version 7.7 and 7.8. I know of many of you have already have upgrades Siebel to 8.1, and so have we! This gave me a chance to update my old article on the SiebList object. Not much has changed, actually, but the code here has been optimized for better performance and compatibility with the latest version. Information regarding its limitations has also been included.

{ 9 comments }

This article is a tutorial which shows how parts of GMail can be automated through QuickTest Professional. GMail is an extremely dynamic UI and always quite challenging to automate successfully. Its dynamic behavior also makes it an excellent candidate to practice QTP with and sharpen your skills. I will try to show a few techniques that can be helpful in automating GMail, and through it, automating any dynamic application that you encounter.

{ 105 comments }

This is a short review of the book QuickTest Professional Unplugged, which is the first book of its kind to be made available to the QuickTest community.

{ 7 comments }

This article demonstrates a quick tip to activate, minimize or maximize browsers. Unlike a Standard Windows Window object, Browser does not support the Activate, Minimize, Maximize methods. Therefore, we can create our custom function and tie it with the Browser object using RegisterUserFunc.

{ 57 comments }

Site Upgrade

by Anshoo Arora on March 6, 2010

This was a long time coming and I was finally able to upgrade all my Wordpress and Theme files. The new layout is a single column 3-footer-widget layout to maximize readability and focus on what really matters most – the content.

I see a few loose ends but these are minor issues and I will try to fix them one by one as we go along. I hope you enjoy reading the articles, and also the new layout!

Thanks for visiting Relevant Codes.

P.S. Don’t forget to subscribe to Relevant Codes :)

{ Comments on this entry are closed }

This article shows a quick and easy way to use DLLs in QTP and access their methods with the help of DOTNetFactory. It also shows a working example of a DLL created in Visual Basic .NET and its methods accessed in QTP.

{ 106 comments }

In the previous article, we parameterized a test for a Login process with the help of QTP’s Local DataTable. This topic covers the same concept with the help of an (external) Excel file. The process will remain the same, but how we extract data differs.

{ 136 comments }

The first release of RelevantCodes[1]One, a Keyword-Driven Automation Framework Demo Project is available and ready for download. Usage examples and Videos included.

{ Comments on this entry are closed }

GetROProperties (Custom)

by Anshoo Arora on December 10, 2009

There have been numerous threads/discussions about the lack of GetROProperties, which is not available with the QuickTest package. There is GetTOProperty, GetROProperty, GetTOProperties and until now, GetROProperties was the only method missing from the pack. Now, its available and it works just like GetTOProperties does.

{ 21 comments }

This post demonstrates the custom method RegisterUserFuncX, which can be used to automatically register custom methods to all objects automatically. Be sure to read the comments by Tarun and Motti which cover one limitation with resolution of the other. Enjoy.

{ 33 comments }

The generic framework for the community is nearly ready. I would really appreciate if I can have 5-10 volunteers to test it. It comes with 3 test cases which show its working on a single browser, on multiple browsers simultaneously and on a standard windows application [This topic has been locked. You will not be able to post comments].

{ Comments on this entry are closed }

There are several instances where automation developers have to work with applications containing multiple windows, in a Standard Windows Environment. This technique uses a similar methodology as demonstrated in the article for Web-based apps, but the crux of this technique differs. It can be used by automation developers testing most types of windows applications.

{ 12 comments }

Parameterization is a process in which parameters, or variables are substituted for hard-coded values which help perform the same operations on the AUT with multiple sets of data. In other words, in QTP, parameterization helps automation developers test an application with different data from a single action (or multiple actions) through multiple iterations.

{ 115 comments }

This post contains the updates regarding the upcoming automation framework as well as some ideas that might be included in its first release, which will be available for trial and download sometime during January 2010. Enjoy!

{ 23 comments }

This post describes a simple technique that can enable retrieval of a Link’s onMouseOver color by simply changing the ReplayType setting before the onMouseOver FireEvent Event.

{ 36 comments }

In this article, we will see a few interesting ways to automate the Windows Calculator. The concepts in this article should serve as an excellent way of understanding the automation process with QTP, how functions can help increase code reuse, and why at times its extremely important to validate user-input. A must read!

{ 24 comments }

This article will discuss the concepts of Custom Checkpoints, their benefits, when to use them and how they provide us with greater flexibility in script development. Custom CheckPoints offer an easier and highly flexible way of construction your object verifications, which is a core concept of test automation. The concepts below, when coupled together can help you build extremely robust scripts, with enough information that your user desires.

{ 65 comments }

Automated tests are created mainly to be run unattended, and this raises a few concerns for automation developers. Assume a situation where you initiated your test-suite while leaving your office to be run over-night. However, because of unforeseen errors, your test stops at a point and disrupts your results.

{ 92 comments }

Web applications due to their dynamic nature, make script development quite challenging. I am writing this article in an attempt to simplify one of its aspects that automation developers face while working with Web applications. We will see how it can be made extremely easy to work with multiple browsers with the use of a Dictionary object, to which we can add Browsers, remove them, change the way we reference them and much more.

{ 29 comments }

We had an issue with one of the SiebButton objects’ in our environment. When we executed a statement to click on this particular SiebButton, the next statement would not execute. What happens is, as we click this particular SiebButton, a Dialog box pops up immediately. For some reason that we have not been able to figure out, the execution marker from the SiebButton(“”).Click statement will not move to the next line.

{ 9 comments }

This article describes how the management of test data can be greatly simplified with the help of ADO and the Dictionary Object. This concept shows how your data-pool needs to be accessed only once to create a highly efficient and fast-performing data-dictionary. Examples and Demos included.

{ 71 comments }

Today, after being quite tired of switching windows between Notepad++ and QTP, I started experimenting with different layouts I can create to make the the QuickTest editor a little more viewing-friendly. After a few minutes of playing around, I finally have something that I like.

{ 15 comments }

Upcoming: Automation Framework

by Anshoo Arora on September 29, 2009

I have been planning for a while now to release a framework for our community. I even started on a few ideas, but I felt it would be best if I received some feedback from you guys. Please use the comment section of this post to share your ideas of what you would like to see included in the framework.

{ 54 comments }

This article outlines how and when descriptions can be created at run-time to minimize code, and ease maintenance. Examples and Demos included.

{ 12 comments }

This article demonstrates how working with large object hierarchies (like Siebel’s) can be greatly simplified in QTP by using one of the 4 techniques mentioned here.

{ 22 comments }

This article covers the principles of creating a Description Object in QTP and its amazing use with the ChildObjects method. We will see how we can create an object description with a single property, with multiple properties, by using regular expressions and finally putting all these concepts into their application with the ChildObjects method.

{ 126 comments }

QTP: Create Test Archives

by Anshoo Arora on August 27, 2009

This post explains how to create test archives elegantly and quickly and store all run-time files with a date and time stamp.

{ 0 comments }

This article demonstrates an elegant approach to working with multiple Browsers through the use of Classes and Dictionary Object. Examples included.

{ 0 comments }

This article outlines how one can avoid the 10-15 delay with QTP 9.2 with 1 open browser.

{ 8 comments }

Like the previous article, this will also be a little fast-paced and will cover how to create a Custom form and add a RadioButton control to it.

{ 10 comments }

In this article, we will see how we can add and use multiple objects in a user form. It will cover the concepts discussed in the previous 4 articles.

{ 8 comments }

This article will cover the basics of DOTNetFactory with QTP and demonstrate the technique of adding a CheckBox Control to a Custom Form.

{ 4 comments }

This article will cover the basics of DOTNetFactory with QTP and demonstrate the technique of adding a Button Control to a Custom Form.

{ 8 comments }

This article will cover the basics of DOTNetFactory with QTP and demonstrate the technique of adding a TextBox Control to a Custom Form.

{ 9 comments }

In this series of articles, we will discover how to use the DOTNetFactory to create a user form and how to add different object types to it.

{ 13 comments }

Usage of modular classes helps in keeping all methods and properties for a module intact, and if done correctly, this can simply maintenance greatly.

{ 51 comments }

This is the 4th article in the series and will show how DP can be used to create a test module in QTP.

{ 112 comments }

This article outlines the concepts of Ordinal Identifiers used in QTP. We will also create a simple test module (step by step) for a login process using only Descriptive Programming (DP).

{ 74 comments }

This article compares the uses of Descriptive Programming vs Object Repository in QTP.

{ 57 comments }

This article discusses 2 ways of sending e-mail from your Yahoo, Hotmail, Gmail, Live or AOL e-mail accounts using the ‘clsSendMail’ class:

{ 34 comments }

This article discusses an elegant way of multiple cross-checking expected vs actual properties of objects.

{ 31 comments }

This article shows a technique that can be used to synchronize QTP with AJAX applications.

{ 24 comments }

This topic provides an excellent introduction to Regular Expressions with DP in QTP. It also discusses the famous wild card character in detail.

{ 61 comments }

Descriptive programming has become the technique of choice for many QTP test developers. This topic provides an excellent introduction to DP with QTP.

{ 128 comments }

This article outlines a few techniques to close Internet Explorer (IE) browsers in QTP (Closing browser techniques).

{ 43 comments }

This article outlines an easy way to retrieve object count when working with QTP. It can be used to include and exclude hidden objects in the page, to retrieve only the visible object count.

{ 27 comments }

This topic outlines the use of XMLHTTP object in VBSCript. It will show how to retrieve Server-side response without physically opening the page.

{ 3 comments }

In this topic we will learn how to pass 2 or more values from function using Global Variables, Arrays, Dictionary Objects, Concatenated Strings and with the use of ByRef.

{ 3 comments }

This article demonstrates the differences between ByRef and ByVal in VBScript. It will also provide the pros and cons and excellent examples to get you started immediately.

{ 17 comments }

Inheritance in VB.NET

by Anshoo Arora on August 10, 2009

In OOP, Class Inheritance has been one of the most important topics and it has been around since 1967 The idea behind class inheritance is to enable the inheriting (derived) classes use attributes of the base classes. This enables programmers to reuse the code by having derived classes share the functionality of their base classes [...]

{ 0 comments }

This is the 4th article in the Siebel series. In this article, we will detail an effective way to work with the Siebalculator Object using QTP. Examples included.

{ 0 comments }

This article introduces the SiebList object in a QTP and Siebel Environment, and demonstrates some methods that can help in working with a SiebList like an expert.

{ 4 comments }

This article introduces the SiebPickList object in a QTP and Siebel Environment, and demonstrates some methods that can be performed to enhance working capabilities in Siebel.

{ 3 comments }

This article introduces the Siebel add-in with QTP and outlines various techniques to work with Siebel objects. It also offers an excellent introduction to the Siebel automation process with QTP.

{ 44 comments }

I’m sure you’re aware of Classes, which on a high-level are user-defined types, and their instances are objects. Vb.NET has introduced a new type, called an Interface. An Interface, according to this article by Nick Harrison, “is a contract that defines the signature of some piece of functionality”. This contract is fulfilled by the Implementing [...]

{ 1 comment }

The IsObjectFound class implements the search function for the specified web object and returns true if a visible instance is found. Considers Visible and Hidden Objects.

{ 8 comments }