Facebook

Course Name Start Date Time Duration Registration Link
No Training Programs Scheduled ClickHere to Contact
Please mail To sudhakar@qtpsudhakar.com to Register for any training

Tuesday, March 27, 2012

Component, Distributed Component, Automation and Document Object Model


Component Object Model
Microsoft COM (Component Object Model) technology in the Microsoft Windows-family of Operating Systems enables software components to communicate. COM is used by developers to create re-usable software components, link components together to build applications, and take advantage of Windows services. The family of COM technologies includes COM+, Distributed COM (DCOM) and ActiveX Controls.

COM is used to give structured software architecture. COM objects are discrete components, each with a unique identity, which expose interfaces that allow applications and other components to access their features. COM objects are more versatile than Win32 DLLs because they are completely language-independent, have built-in interprocess communications capability, and easily fit into an object-oriented program design.

COM is used in applications such as the Microsoft Office Family of products. For example COM OLE technology allows Word documents to dynamically link to data in Excel spreadsheets and COM Automation allows users to build scripts in their applications to perform repetitive tasks or control one application from another.

Distributed Component Object Model
Distributed Component Object Model is an extension of the Component Object Model (COM) that allows COM components to communicate across network boundaries. Traditional COM components can only perform interprocess communication across process boundaries on the same machine. DCOM uses the RPC mechanism to transparently send and receive information between COM components (i.e., clients and servers) on the same network.

Automation Object Model
An object model is a structural representation of software objects (classes) that comprise the implementation of a system or application. An object model defines a set of classes and interfaces, together with their properties, methods and events, and their relationships.

These Object Models are developed based on COM technology. The QTP Automation Object Model will give structural representation of QTP classes. Using this we can access QTP options from any other applications by using a scripting or programming language. An Object Model will give a facility to control the functionality of an application programmatically.

QTP Automation Object Model developed based on COM and DCOM. We can automate QTP operations by writing VB scripts. It is possible because of COM. We can run our QTP scripts on a remote machine which is in the network. It is possible because of DCOM. To know how to run QTP Scripts on a remote machine follow this path…

Go to QTP HELP by pressing F1 in QTP à QuickTest Advanced References à QuickTest Professional Automation Object Model à Introduction à Learning the Basic Elements of a QuickTest Automation à Running Automation Scripts on a Remote Computer

Document Object Model
Document Object Model (DOM), a programming interface developed by the World Wide Web Consortium (W3C) to create and modify HTML pages and XML documents.

With the Document Object Model, programmers can create and build documents, navigate their structure, and add, modify, or delete elements and content. Anything found in an HTML or XML document can be accessed, changed, deleted, or added using the Document Object Model. The Document Object Model can be used with any programming or scripting languages.

 To Learn XML Dom navigate to https://www.w3schools.com/xml/dom_intro.asp
To Learn HTML Dom navigate to https://www.w3schools.com/js/js_htmldom.asp

How DOM is useful for Automation Testers?
DOM is useful when working with web applications. We go for DOM to access internal properties or methods of a web application. “.Object” property is used to access internal properties or methods. To see available internal methods and properties, go to Object Spy à point to any web object à select Runtime object properties radio button

For QTP 10 select Native Properties Radio button


Below code is to get internal property or to access internal method of a web edit 

Msgbox Browser("Google").Page("Google").webedit("q").object.value
Browser("Google").Page("Google").webedit("q").object.focus

Focus is a method and Value is a property for webedit.
Object is a property for every QTP web object to access internal properties or methods.

No comments :

Post a Comment