Akien MacIain, Senior Automation Engineer, Delta Dental of California Table Of Contents Introduction. 2 Overview. 2 The BagObject Framework. 4 Creating new BagClasses. 4 Adding Methods to a BagClass. 4 Adding Properties to a BagClass. 5 Creating BagInstances of a BagClass. 6 Calling methods and properties. 6 How it’s most commonly used. 6 Custom Signatures. …
Tag Archive: vbscript
Dec 08
Adding a Call-Chain Mechanism to QTP
Background and motivation A common frustrating experience is having your script pop-up an error dialog in some long-forgotten function, without one having the slightest clue in its regard. What usually follows is a series of trial-and-error breakpoint runs to determine which action the script was actually trying to perform when executing the function call that …
Oct 15
Class Inheritance in VBScript – Now at your Doorstep!
ChangeLog: 5/10 : I’ve uploaded a new file with the fixed parser. Added support for code blocks with sensitive names (Function PrivateFunciton, Sub SpecialGet etc.) 10/10 : I’ve uploaded a new file with constructor arguments support, and a new regular expression engine (preserves comments and should make things go faster). Notice that the new file …
Oct 10
Constructor Arguments in VBScript!
Our Class Inheritance Parser has just received a major update. Among the changes is the support for Constructor Arguments. Most programming languages allow you to pass parameters when you create an instance of your class. These are called constructor arguments. VBScript’s constructor (the Class_Initialize sub) can not receive parameters, so usually we must resort to …
Jun 24
Private Investigation: System.Collections.ArrayList
Lately many user sending me question about .NET objects, and how they could be used in QuickTest So, I decided to make a research, on one of the most efficient .NET collections: the System.Collections.ArrayList Probably you will see over the network, a lot of examples using this object. Usually they are very basic. The examples …
Apr 01
Return ASCII Character Code of a Letter
The Asc function returns the ASCII code of the first character in the string. Print Asc( “ABCD” ) ‘ prints 65
Apr 01
Convert ASCII Value to Character
The Asc function takes an ASCII character code and returns the character. Print Chr( 65 ) ‘ prints “A” Print Chr( 34 ) ‘ prints ” ( quote )
Apr 01
Convert String to a Number
Use the CInt function to convert a string to Integer data subtype representation. Use the CDbl function to convert a string to Double data subtype representation. Use the CSng function to convert a string to Single data subtype representation. Use the CLng function to convert a string to Long data subtype representation. Use the CByte function …
Apr 01
Convert Number to a String
Use the CStr to convert a number into it’s string representation pi = 3.14 Print CStr( pi ) ‘ Prints “3.14″
Apr 01
String Contains Substring?
Use the InStr function to determine if a string contains a sub string. Dim str s = "AdvancedQTP" ‘ ** The following 4 lines are case-sensitive Print InStr( s, "Advanced" ) ‘ Prints 1 Print InStr( s, "QTP" ) ‘ Prints 9 Print InStr( s, "xyz" ) ‘ Prints 0 Print InStr( s, "qtp" …



Recent Comments