
October 4th, 2008 by

Yaron Assa

Loading ...
VBScript’s lack of class inheritance can be quite problematic for those of us who are using Classes regularly throughout our scripts. The attached file provides a parser which enables you to effectively use class inheritance in VBScript by placeing ‘ ParentClassName comments within your classes. The mechanism will:
1. Enable inheritance from multiple parents (just use multiple lines with Inherit comments)
2. Copies Properties, Variables, Functions and methods from the parent class to the derived class.
3. In case the derived class already has a code segment with the same name, the copied code-segment is changed to MyBase_. Inner segment placements are updated accordingly.
4. Enables inheritance through multiple hierarchies (e.g. GrandParent->Parent->Child inheritance). Circular inheritance protection. The order of appearance in the files is irrelevant, the parser will make sure the parent classes are parsed before their derived classes.
5. The parser has a major downside – as the technique uses ExecuteGlobal to load the processed classes into QTP, you cannot debug the code in mid-run.

June 19th, 2008 by

Yaron Assa

Loading ...
This article will offer an improved version of the native Scripting.Dictionary object, and provide a step-by-step guid for building it.

March 29th, 2008 by

Yaron Assa

Loading ...
This article deals with classes and their instances in VBScript. Make sure you’re familiar with the subject by reading the introduction article to classes.
In this article we’ll cover the basics for composing classes (i.e. using one class from within another), and some common and less common uses for this technique. I’m sure that once you’ll see the huge benefits we can gain by selectively using this technique, you’ll at least try it.

March 29th, 2008 by

Yaron Assa

Loading ...
This article will very briefly cover the subject of VBScript classes. My purpose is not to do a detailed sweep, but only a quick reminder in order to move forward to more advanced topics and techniques in articles to come. You can find detailed information and demos on this subject in the book Scripting Quicktest […]

March 29th, 2008 by

Yaron Assa

Loading ...
This article refers to design patterns, pointers and objects (discussed in the background section of this article), and classes. Make sure you’re familiar with these issues before reading on. It would also be prudent to brush up on the Singleton Pattern.
We continue our tour of Design Patterns with another basic pattern – the Factory (or […]

March 29th, 2008 by

Yaron Assa

Loading ...
This article refers to design patterns, pointers and objects (discussed in the background section of this article), and classes. Make sure you’re familiar with these issues before reading on.
We begin our exploration of the word of Design Patterns with one of the simplest patterns – the Singleton. The Gang of Four eloquently summarize the intent […]

March 29th, 2008 by

Yaron Assa

Loading ...
This section relays heavily on your familiarity with basic code design concepts and approach. Make sure you read the introduction to code design before proceeding.
Parts of the following introduction are rewrites (more accurately downgrades) of the preface to the groundbreaking book Design Patterns: Elements of Reusable Object-Oriented Software, written by the “Gang of four”. If […]

March 29th, 2008 by

Yaron Assa

Loading ...
Many of QTP’s downsides are due to the inherent tension between trying to be beginner-friendly, to having enough depth and complexity for writing real automation scripts. It’s more than just having too many menus and options – in some cases; QTP induces shallow thinking and bad habits. I apologize for being dramatic, but in my […]

March 29th, 2008 by

Yaron Assa

Loading ...
Abstractions
Abstractions are the cornerstone of any successful program. An abstraction is a blackbox, wrapped around some very complex real-world mechanism. This magical blackbox allows us to use it, without dealing with the actual complexity that goes on inside.
For example, characters are abstractions: There is no character data type in the real world, since characters are […]

March 29th, 2008 by

Yaron Assa

Loading ...
Background & Motivation
Negative tests are a crucial part of application testing – they ensure us the application contains “bad” user behavior and illegal inputs in a controlled fashion. Having said that, usually there’s never enough time, resources and personal to automate the “positive” tests; let alone the negative ones. This is not an inevitable situation […]

March 29th, 2008 by

Yaron Assa

Loading ...
Today we’ll cover a valuable technique that will enable us to greatly simplify and organize our code, by adding meta-data to our QTP objects. The technique is best used when coupled with DP, though with certain adjustments, it works fine with OR based scripts as well.
The content you are accessing is for registered users onlyRegisteration […]

March 29th, 2008 by

Yaron Assa

Loading ...
This will be the first of many articles dealing with code design. What is code design? In object oriented languages it sometimes stands for deciding on the object class and structures needed to elegantly complete a task. For us it will just be a set of abstract principles that will allow us to write readable, […]

October 22nd, 2007 by

Meir Bar-Tal

Loading ...
This 14-page article by Meir Bar-Tal explains in details the benefits and inherent possibilities in wrapping our functions with classes. It further explores the meaning and logical structure of classes, and shows how we can easily implement constructors, event handlers and callback by using class composition and function wrapping.
The different techniques are well illustrated […]
Recent Comments