Welcome To Automation Testing

Before starting with tips of automation of SAP using QTP Let me give a small introduction of SAP and QTP.

SAP stands for System Applications and Products. It is the name of both the online financial and

Administrative software and the company that developed it. SAP is made up of individual modules that perform various organizational system tasks.



Quick Test Professional (QTP) is an automated functional Graphical User Interface (GUI) testing tool that allows the automation of user actions on a web or client based computer application.

It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test. It supports many applications through the support of add-ins.



We will be using SAP add-in with QTP to work on the SAP automation.

Tuesday 18 December 2012

CreateObject in QTP/vbScript


CreateObject is function which creates a reference to the specified object. You can then use the reference object to access the methods/properties of the specified object.

As createobject returns a reference to object, you must use Set to assingn it to a variable.

Set objExcel=CreateObject(“Excel.Application”)
‘Adding a workbook
Set objWorkBooj= objExcel.Workbooks.Add
‘Activating the sheet
Set objSheet=objWorkBook.Worksheets("Sheet1")
‘Writing values to excel
objExcel.Cells(row,column)=<”Your value>”

Below is the list of most commonly used objects. I hope you find it useful.

S.No
Object
Description
1
Set ObjectName= CreateObject("Wscript.shell")
Provides access to the native Windows shell. Provides functions to read system information and environment variables, to work with the registry and to manage shortcuts.
2
Set ObjectName = CreateObject("WScript.Network")
Provides access to the shared resources on the network to which the computer is connected.
3
Set ObjectName = Createobject("Excel.Application")
Perform operations on MS Excel.
4
Set ObjectName = CreateObject("Word.Application")
Perform operations on MS Word.
5
Set ObjectName = CreateObject("Outlook.Application")
Perform operations on MS Outlook.
6
Set ObjectName = CreateObject("InternetExplorer.Application")
Perform operations on Internet Explorer.
7
Set ObjectName = Createobject("QuickTest.Application")
Perform operations on Quick Test Professional (QTP).
8
Set ObjectName = CreateObject("QuickTest.UpdateRunOptions")
A collection of properties that indicate preferences for the Update Run in QTP.
9
Set ObjectName = CreateObject("QuickTest.RunResultsOptions")
A collection of properties that indicate preferences for the run results in QTP.
10
Set ObjectName = CreateObject("Scripting.FileSystemObject")
To work with the Windows file system structure: files, folders, drives.
11
Set ObjectName = CreateObject("Mercury.DeviceReplay")
Perform mouse or key operations exactly as they occur on the mouse or keyboard drivers.
12
Set ObjectName = CreateObject("Mercury.ObjectRepositoryUtil")
Perform an operation on QTP Object Repository.
13
Set ObjectName=CreateObjcet("Scripting.Dictionary")
Creates a dictionary object
14
Set ObjectName=CreateObject("vbScript.RegExp")
Creates a regular expression object
15
Set ObjectName = CreateObject("Mercury.FileCompare")
To compare two files.
14
Set ObjectName = CreateObject("Mercury.Clipboard")
Perform clipboard functionality.
15
Set ObjectName = CreateObject("Msxml2.DOMDocument")
Creates a DOMDocument object to perform operations related to XML document.
16
Set ObjectName = DotNetFactory.CreateInstance (TypeName [,Assembly] [,args])
Returns a COM interface for a .NET object.
17
Set ObjectName = Createobject("shell.application")
To instantiate the Shell object, to program the Shell which can be used to access the file system, to launch programs, and to change system settings.
18
Set ObjectName= Createobject("TDApiOle80.TDConnection.1")
An object that enables to manage the Quality Center connection and retrieve the TDOTA object, which provides full interaction with Quality Center.
19
Set ObjectName = CreateObject("Microsoft.XMLDOM")
To access and manipulate XML documents via the XML DOM implementation, as exposed by the Microsoft XML Parser.
20
Set ObjectName = XMLUtil.CreateXML()
Creates and returns an object of type XMLData. If a root name is specified, a new document is created containing the specified root tag.
21
Set ObjectName = CreateObject( "AcroExch.App")
Acrobat OLE Automation Objects.
Set ObjectName = CreateObject( "AcroExch.AVDoc")
Set ObjectName = CreateObject( "AcroExch.PDDoc")
Set ObjectName = CreateObject( "AcroExch.HiliteList")
Set ObjectName = CreateObject( "AcroExch.PDBookmark")
Set ObjectName = CreateObject( "AcroExch.Rect")
22
Set ObjectName = CreateObject("ADODB.Connection")
Creates an instance of the ADO connection to connect to database.
23
Set ObjectName = CreateObject("ADODB.Recordset")
Creates an instance of the recordset object. To be able to read database data, the data must first be loaded into a recordset.
24
Set ObjectName =CreateObject("msscriptcontrol.scriptcontrol")
Perform operations to MS Windows Scripting Engine.
25
Set ObjectName = CreateObject("SAPI.SpVoice")
Auditory voice feedback during a test run, done by utilizing the Microsoft Speech API.
26
Set ObjectName = CreateObject( "UserAccounts.CommonDialog")
Object to provide users with a standard File Open dialog box
27
Set ObjectName = CreateObject("CDO.Message")
Windows CDO object is suitable for creating and sending automated emails.

10 comments:

  1. good guidence and the following of the content is so helpfull and usefull. SAP SECURITY TRAINING

    ReplyDelete
  2. This blog is very useful which is related to my requirements... SAP BASIS Administration

    ReplyDelete
  3. Thanks for your informative article on UFT automation testing tool. Your post helped me to understand the features and functionality of QTP automation testing tool. Best QTP training institute in Chennai

    ReplyDelete
  4. Your posts is really helpful for me.Thanks for your wonderful post.It is really very helpful for us and I have gathered some important information from this blog.If anyone wants to get PLC Training in Chennai reach wiztech

    ReplyDelete
  5. Thanks for this article.You can visit my website :view insta dp

    ReplyDelete
  6. What a great platform that for such nice information Have a Look keep up the good work thanks!visit here:showbox for android download

    ReplyDelete
  7. Hi This is SRK i'm suggesting you this is app Kodi Apk

    ReplyDelete