(examples:- Ways and concepts to show , how QTP handles AUT objects)
Component Object Model ( COM )
COM is an object model and an Application Binary Interface(ABI)that allows applications/objects (Excel objects, FSO objects) to interact and expose its functionality to other applications/objects (Excel objects, FSO objects) in different environments(programming language , operating systems) , by providing methods and functions to use and manipulate applications/ objects
Example:-Applications involved are Excel objects, FSO File System objects
·CreateObject creates an Automation object of the specified class.
·Set statement creates the reference between the object variable and the object.
·GetObject method returns a reference to an instance of an object. It can be used in two way with its parameters, the object’s path name and the object’s ProgID.
Following code uses COM objects (Outlook application ) to send mail
'Create an object of type Outlook
Set objOut = CreateObject("Outlook.Application")
Set myOutMail = objOut .CreateItem(0)
'Set the properties of email
myOutMail .To = "firstname.lastname@example.org"
myOutMail .Subject = "Demo of COM object Outlook"
myOutMail .Body= "We are using Outlook application in COM"
'Send the mail
*Note :ABI Application Binary interface is the interface between two program modules, library or operating system, at the level of machine code .
ABI differs from API i.e. Application Programming interface (APIs), which similarly define interfaces between program components, but at the source code level.