Posts

Showing posts with the label QTP/UFT

Comparing 2 Text Files Using Vbscript/QTP

How to compare 2 text files The following function can be used to check and compare the content of the two files. Note: This function is not part of QuickTest Professional/Astra QuickTest. It is not guaranteed to work and is not supported by Mercury Interactive Technical Support. You are responsible for any and all modifications that may be required. CompareFiles (FilePath1, FilePath2) FilePath1 The path to the first file to compare FilePath2 The path to the second file to compare Public Function CompareFiles (FilePath1, FilePath2) Dim FS, File1, File2 Set FS = CreateObject(“Scripting.FileSystemObject”) If FS.GetFile(FilePath1).Size FS.GetFile(FilePath2).Size Then CompareFiles = True Exit Function End If Set File1 = FS.GetFile(FilePath1).OpenAsTextStream(1, 0) Set File2 = FS.GetFile(FilePath2).OpenAsTextStream(1, 0) CompareFiles = False Do While File1.AtEndOfStream = False Str1 = File1.Read(1000) Str2 = File2.Read(1000) CompareFiles = StrComp(Str...

Using Dictionary Objects in QTP

Dictionary Object stores data key, item pairs. A Dictionary object stores the items in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and is usually an integer or a string, but can be anything except an array. Adavntages of using it in QTP: 1. can be used as Global variable declaration. so that any test can access the values from it in the run time. 2. You can store and retrive any number of run time values in to dictonary. 3. It is one of the Parameterization techique we can use in QTP Disadvantages: we can not specify the values in the desingn time like Datatable , Action parameters, environment variable. So it is useful only in Run time , not design time Methods: Add Method Adds a key and item pair to a Dictionary object. object.Add (key, item) Arguments object Required. Always the name of a Dictionary object. key Required. The key associated with the item being added.item Required. The it...

Third Party Libraries For Handling Test Data In Selenium

There are multiple open source solutions available to read/write date from external file in Selenium, few of them are as follows –          JUnit as the test driver          TestNG as the test driver          Apache POI library          JExcel API Library          Filo -1.4.jar library          YAML          SQLite

QTP vs. Selenium

This article demonstrates bird eye comparison between HP QuickTest Professional and Selenium. These are popular test automation tool, specially, for functional & regression testing. Purpose of this comparison is not to say which is better tool, it consists of comparison of tool based on different criteria like supported O/S, browser, object spy, object repository, license cost etc. This article is targeted for readers having prior working knowledge of automation approach & at-least one automation tool. Quick overview of tools is as follows – Introduction HP QuickTest Professional is a graphical user tool & provides solution for functional test and regression test automation. This next-generation automated testing solution deploys the concept of keyword-driven testing to enhance test creation and maintenance. QuickTest Professional meets the needs of both technical and non-technical users. It works hand-in-hand with HP Business ...

QTP Best Practices

HP Quick Test Professional is a test automation tool, also known as QTP. It is used to automate functional, regression & smoke test cases. It is a very popular tool and works on MS windows O/S, supports development technologies like Active X, Delphi, Java, .Net, Oracle, People Soft, web, Web services etc. This article discusses about best practices while doing automation using QTP.     Don’t use msgbox function, this function pauses the script execution & requires user intervention. This defeats the objective of unattended script execution. To store or display error message and execution log use QTP inbuilt Reporter object.        Follow coding guidelines like comments, variable & function name declaration.        Use option explicit to enforce variable declaration. Always define variables at the top of script & function file        Neither hard code test data nor read value using...

How to Perform right Click Using QTP

'The below code can be used to perform mouse right click whereever required  Browser(”Browser”).Page(”Page”).WebTable(”table”).FireEvent “onclick”,,,micRightBtn   ‘Right clicking on th e object