Blog to understand automation concepts in QTP, Selenium Webdriver and Manual Testing concepts

Utility Function for Working with Loading OR/Libraries, Capturing Image/Text and QTP Reporter in QTP

Below are some of the useful utility functions in QTP

Loading OR/Libraries


1.    Function to load Library Dynamically:

This function will load function library at runtime with the test.
 LoadFunctionlibrary(Library Name)

2.    Function to Load OR dynamically:

This function will add an object repository to the test dynamically at run time.
 RepositoriesCollection.AddRepositoryName

Capturing Image/Text


3.   Capturing Image at run time:

    This will capture the screenshot at runtime
    Browser(“…”).Page(“…”).capturebitmap(path to store image”)


4.   Capture Text:

This will capture the text at runtime to the clipboard. 

setobjClip=createobject("Mercury.Clipboard")
objClip.SetText(someText)
printobjClip.GetText

Reporting event


5.    Reporter.reportEvent: 

   This will add user defined result to the QTP Results
   Reporter.reportEventstatus,Event,Details

6.    Reporter.Filter:

This will filter the events to be written in QTP
Reporter.Filter = rfEnableAll

7.    Systemutil.run:


 This will execute statement similar to what we write in the run in start menu
Systemutil.run(Process)



1 comment:

  1. Thanks for giving important information to training seekers,Keep posting useful information

    QTP Training in Chennai

    ReplyDelete