Sunday, April 29, 2012

"Setting" utility object to access registry values

We can obtain and configure all the QTP configurable parameters(all parameters in MicTest) using "Setting" utility object. Ex: BrowserType, DefaultLoadTime etc...
For Ex: If you want to retrieve the default location of saving your tests, which exists in HKLM\Software\Mercury Interactive\QuickTest Professional\MicTest\TestsDirectory, you can use below line of code:
Setting
print Setting("TestsDirectory")

You can also use Setting.Item to retrieve the value of the parameter. For the above, you can also use like:
print Setting.Item("TestsDirectory")

If you want to access a parameter exists in folders, then you can use
Setting("")("Child1")("Child2)("PropertyName")

Here is the Ex. to access the Add-In Manager name for Visual Basic.
print Setting("AddIn Manager")("VisualBasic")("Name")


No comments: