Search code examples
qtp

QTP11 How to use generated setting vbs script?


I downloaded QTP version 11 for the first time to see what is QTP. I'm using Web, ActiveX add-on to test web application.

I looked thru help documentation and but not able to find my answer.

File > Settings > Properties tab,

there is "Generated Script" to generate vbs file for setting.

Inside looks like:

Dim App 'As Application
Set App = CreateObject("QuickTest.Application")
App.Launch
App.Visible = True
App.Test.Settings.Launchers("Web").Active = True
App.Test.Settings.Launchers("Web").Browser = "IE"
App.Test.Settings.Launchers("Web").Address = "http://www.w3schools.com/Html/tryit.asp?filename=tryhtml_link_target"
App.Test.Settings.Launchers("Web").CloseOnExit = True

...continue

So now I have this vbs file that I want to apply the setting for my test. How can I do it???


Solution

  • Have you looked at the documentation for the Generate Script button?

    Generates a QuickTest automation script containing the current test settings.

    When you click the Generate Script button, a Save As dialog box opens, enabling you to specify the name and file system location to store the generated file.

    You can use some or all of the script lines from this generated script in an automation script. This can be useful, for example, if you want to open a test with required test settings already set or to set the same test settings for multiple tests by looping through the tests in a folder.

    For details, see QuickTest Automation Scripts and the QuickTest Professional Automation Object Model Reference (Help > QuickTest Professional Help > HP QuickTest Professional Advanced References > HP QuickTest Professional Automation Object Model).