The first step toward success is taken when you refuse to be a captive of the environment in which you first find yourself.

This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Wednesday, 19 October 2011

QTP Script: Write a value to the Registry

' ============================================================= ' Sub :    RegistryWrite ' desc :   Writes a key value to the registry ' params : strRoot is the root key, i.e. "HKLM", "HKCU" '          strPath is the path to create, i.e.  '          "Software\Test\Automation" '          strValue is the value to write in the key ' returns : void ' =============================================================...

QTP: Example of how to write text to a file

' ============================================================= ' function: WriteLog ' desc :    Writes a message to a log file. File is created '           inside a Log folder of the current directory ' params :  strCode is a code to prefix the message with '           strMessage is the message to add to the file ' returns : void ' ============================================================= Function WriteLog(strCode, strMessage)...

QTP Script: Using Description Objects to interact with a web page

This example will illustrate how to use description objects to interact with a web page, www.QTPHelper.com to be more exact...  Note that for the Browser and Page I've used programmatic descriptions, but for the buttons, edits and check-boxes I've used Description Objects. Also take note of the regular expression in the Browser and Page description, just in case the titles change in the future.  You can add more properties to your description objects if you need to, i.e. if your web page has numerous objects of the same type with similar...

QTP Script: Using the replace method to find and replace text in a string

MsgBox ReplaceText("Automating with QTP is rubbish.", "rubbish.", "great!") MsgBox ReplaceText("QTP is a great automation tool but I can't use it","but.*","!") ' ============================================================= ' function: ReplaceText ' desc :    Uses a regular expression to replace text within a string ' params :  strString is the string to perform the replacement on '           strPattern is the regular expression '          ...

QTP Script: Register a procedure with an object class

' add GetItemsCount as a method of the WebList class RegisterUserFunc "WebList", "GetItemsCount", "GetItemsCountFunction" ' ============================================================= ' function : GetItemsCountFunction ' desc : Returns the number of items from a weblist ' ============================================================= Function GetItemsCountFunction(objWebList) If (objWebList = Nothing) Then     GetItemsCount = 0 Else     GetItemsCount = objWebList.GetROProperty("Items...

QTP Script: Read a value from a key in the registry

' ============================================================= ' function : RegistryRead ' desc     : Read a value from the registry ' params   : strRoot is the root key, i.e. "HKLM", "HKCU" '            strPath is the path to read, i.e.  '            "Software\Test\Automation" ' returns :  Value from the registry key ' ============================================================= Function RegistryRead(strRoot, strPath)...