VBScript

Testing Web Services using QTP, VBScript

by Anshoo Arora ON March 16, 2012 · Posted In All, QTP, VBScript · 15 comments

This article was originally requested by one of our visitors – Dhup Chaya. It shows a way to work with Web Services (Google’s Distance Matrix API) using XMLHTTPRequest (sending request & receiving response) and parsing the response with both XMLUtil and XMLDOM.

ExcelUtil Class Library (MS Excel Utility Methods)

by Anshoo Arora ON March 12, 2011 · Posted In All, QTP, VBScript · 28 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.

IE Error: A script is causing IE to run slowly

by Anshoo Arora ON December 5, 2010 · Posted In All, QTP, QTP/Web, VBScript · 11 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.

QTP GUI Objects, VBScript & Try Catch Finally

by Anshoo Arora ON August 30, 2010 · Posted In All, QTP, VBScript · 3 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.

Eval Function & Execute Statement

by Anshoo Arora April 21, 2010 45 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.

VBScript: Compare 2 Excel Files

by Anshoo Arora March 22, 2010 75 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.

CDO: Send Email from Yahoo, Hotmail, Live, AOL or GMail

by Anshoo Arora August 10, 2009 34 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:

Retrieve Server Response using XMLHTTP

by Anshoo Arora August 10, 2009 3 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.

Passing Multiple Values from Functions

by Anshoo Arora August 10, 2009 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.

Passing Parameters ByRef & ByVal (Revised)

by Anshoo Arora August 10, 2009 17 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.