SAP Automation Using QTP
SAP Automation Using QTP
Share
More
Next Blog
Create Blog
Sign In
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.
Members (7) M icrosoft Excel is the only Microsoft Office XP program that has built-in text to Speech (TTS) capabilities. This tip explains how you can use OLE Automation to programmatically access the Excel Object model and use the Text to Speech functionality. Speech M ethod Contains methods and properties that pertain to speech. ABOUT ME Name Speak argument Description Microsoft Excel plays back the text string that is passed as an
Already a member? Sign in
Speak M embers Contains methods and properties that pertain to speech. Syntax expression .Speak(Text, SpeakAsync, SpeakXM L, Purge) expression A variable that represents a Speech object.
http://automatingsap.blogspot.in/
1/5
2/23/2014
Parameters
2012 (17)
Name Text SpeakAsync Required/Optional Required Optional Data Type String Variant Description The text to be spoken. True will cause the Text to be spoken asynchronously (the method will not wait of the Text to be spoken). False will cause the Text to be
spoken synchronously (the method waits for the Text to be spoken before continuing). The default is False .
SpeakXML Optional Variant True will cause the Text to be interpreted as XML. False will cause the Text to not be interpreted as XML, so any XML tags will be read and not interpreted. The default is False . True will cause current speech to be terminated and any buffered text to be purged before Text is spoken. False will not cause the current speech to be terminated and will not purge the buffered text before Text is spoken. The default is False.
Purge
Optional
Variant
Using the Speech Object Use the Speech property of the Application object to return a Speech object. Once a Speech object is returned, you can use the Speak method of Speech object to play back the contents of a string. In the following example, Microsoft Excel plays back Hello, How are you. This example assumes speech feature have been installed on the host system. Code:Set ObjExcel = CreateObject (Excel.Application) ObjExcel.Speech.Speak Hello, How are you?
http://automatingsap.blogspot.in/ 2/5
2/23/2014
Set ObjExcel=Nothing
No comments:
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 Prov ides access to the nativ e Windows shell. Prov ides functions to read sy stem 1 Set ObjectName= CreateObject("Wscript.shell") information and env ironment v ariables, to work with the registry and to manage shortcuts. 2 Set ObjectName = CreateObject("WScript.Network") Set ObjectName = Createobject("Ex cel.Application") Set ObjectName = CreateObject("Word.Application") Set ObjectName = CreateObject("Outlook.Application") Set ObjectName = CreateObject("InternetEx plorer.Application") Set ObjectName = Createobject("QuickTest.Application") Set ObjectName = CreateObject("QuickTest.UpdateRunOptions") Set ObjectName = CreateObject("QuickTest.RunResultsOptions") Prov ides access to the shared resources on the network to which the computer is connected. Perform operations on MS Ex cel. Perform operations on MS Word. Perform operations on MS Outlook. Perform operations on Internet Ex plorer. Perform operations on Quick Test Professional (QTP). A collection of properties that indicate preferences for the Update Run in QTP. A collection of properties that indicate preferences for the run results in QTP.
3/5
3 4 5 6 7 8 9
http://automatingsap.blogspot.in/
2/23/2014
10
Set ObjectName = CreateObject("Scripting.FileSy stemObject") Set ObjectName = CreateObject("Mercury .Dev iceReplay ") Set ObjectName = CreateObject("Mercury .ObjectRepository Util") Set ObjectName=CreateObjcet("Scripting.Dictionary ") Set ObjectName=CreateObject("v bScript.RegEx p") Set ObjectName = CreateObject("Mercury .FileCompare") Set ObjectName = CreateObject("Mercury .Clipboard") Set ObjectName = CreateObject("Msx ml2.DOMDocument") Set ObjectName = DotNetFactory .CreateInstance (Ty peName [,Assembly ] [,args])
To work with the Windows file sy stem structure: files, folders, driv es. Perform mouse or key operations ex actly as they occur on the mouse or key board driv ers. Perform an operation on QTP Object Repository . Creates a dictionary object Creates a regular ex pression object To compare two files. Perform clipboard functionality . Creates a DOMDocument object to perform operations related to XML document. Returns a COM interface for a .NET object. To instantiate the Shell object, to
11
12
13 14 15 14
15
16
17
program the Shell which can be used to access the file sy stem, to launch programs, and to change sy stem settings. An object that enables to manage the
18
Quality Center connection and retriev e the TDOTA object, which prov ides full interaction with Quality Center. To access and manipulate XML
19
documents v ia the XML DOM implementation, as ex posed by the Microsoft XML Parser. Creates and returns an object of ty pe XMLData. If a root name is specified, a new document is created containing the specified root tag.
20
Set ObjectName = CreateObject( "AcroEx ch.App") Set ObjectName = CreateObject( "AcroEx ch.AV Doc") Set ObjectName = CreateObject( 21 "AcroEx ch.PDDoc") Set ObjectName = CreateObject( "AcroEx ch.HiliteList") Set ObjectName = CreateObject( "AcroEx ch.PDBookmark") Set ObjectName = CreateObject( "AcroEx ch.Rect") 22 Set ObjectName = CreateObject("ADODB.Connection") Set ObjectName = Creates an instance of the ADO connection to connect to database. Creates an instance of the recordset 23 object. To be able to read database data,
4/5
http://automatingsap.blogspot.in/
2/23/2014
CreateObject("ADODB.Recordset")
24
Perform operations to MS Windows Scripting Engine. Auditory v oice feedback during a test
25
Set ObjectName = CreateObject("SAPI.SpV oice") Set ObjectName = CreateObject( "UserAccounts.CommonDialog") Set ObjectName = CreateObject("CDO.Message")
run, done by utilizing the Microsoft Speech API. Object to prov ide users with a standard File Open dialog box Windows CDO object is suitable for creating and sending automated emails.
26 27
2 comments:
Home
Subscribe to: Posts (Atom)
Older Posts
Learn QTP
UFT 12 launching soon: Here is a sneak peek on whats new
2 days ago
AdvancedQTP
IsArrayEmpty
3 days ago
www.sqaforums.com
http://automatingsap.blogspot.in/
5/5