Archive for August, 2008

Running Automation Scripts on a Remote Computer

How do you run Automation Scripts on a Remote Computer ?

By default, when you create an Application object in your automation script, it is created on your local computer (using your local copy of QuickTest Professional). You also have the option to run automation scripts on a remote QuickTest computer. To do so, you must:

  • Ensure that the Distributed COM (DCOM) Configuration Properties of the remote computer are set to allow you to run QuickTest Professional Automation from your computer.
  • Specify the remote computer in the automation script in the application creation script line, for example, using the optional location argument in the VBScript CreateObject function.
Setting DCOM Configuration Properties on the Remote Computer

QuickTest automation enables QuickTest to act as a COM automation server. Therefore, to run a QuickTest automation script on a remote computer, you must ensure that the DCOM configuration properties for that computer give you the proper permissions to launch and configure the QuickTest COM server.

The procedure below describes the steps you need to perform on the remote computer to enable your automation script to run on that computer. Note that the DCOM Configuration Property the appearance and names of the dialog boxes and options mentioned here may vary depending on the computer’s operating system.

To enable automation scripts to access a QuickTest computer remotely:

  1. On the computer where you want to run the automation script, choose Start > Run. The Run dialog box opens.
  2. Enter dcomcnfg and click OK. The Distributed COM Configuration Properties dialog box or the Component Services window opens (depending on your operating system) and displays the list of COM applications available on the computer.
  3. Select QuickTest Professional Automation from the list and open the Properties dialog box for the application. (Click the Properties button or right-click and choose Properties, depending on your operating system.)
  4. In the QuickTest Professional Automation Properties dialog box, click the Security tab.
  5. In the launch permissions section, choose the custom option and click Edit.
  6. Use the Add and Remove options to select the network users or groups for which you want to allow or deny permission to launch QuickTest Professional via an automation script. When you are finished, click OK to save your settings.
  7. Repeat steps 5 and 6 for the configuration permissions section to select the users or groups who can modify QuickTest Professional configuration options via an automation script.
  8. In the QuickTest Professional Automation Properties dialog box, click the Identity tab and select the interactive user option.
  9. Click OK to save the QuickTest Professional Automation Properties settings.
  10. Click OK to close the Distributed COM Configuration Properties dialog box or the Component Services window.
Creating an Application Object on a Remote Computer

Once you have set the necessary DCOM Configuration settings for a remote computer, you can specify that computer in your automation script.

In VBScript, you do this by specifying the computer name as the optional location argument of the CreateObject function. The computer name should be the same as the computer name portion of a share name. For example, to run an automation script on a computer called MyServer, you could write:

Dim qtApp

Set qtApp = CreateObject(“QuickTest.Application”, “MyServer”)

For information on the syntax for specifying the remote computer in another language you are using, refer to the documentation included with your development environment or to general documentation for the programming language.

The Properties tab of the Test Settings dialog box, the General tab of the Options dialog box, and the Object Identification dialog box each contain a Generate Script button. Clicking this button generates an automation script file (.vbs) containing the current settings from the corresponding dialog box.

You can run the generated script as is to open QuickTest with the exact configuration of the QuickTest application that generated the script, or you can copy and paste selected lines from the generated files into your own automation script.

For example, the generated script for the Options dialog box may look something like this:

Dim App ‘As Application

Set App = CreateObject(“QuickTest.Application”)

App.Launch

App.Visible = True

App.Options.DisableVORecognition = False

App.Options.AutoGenerateWith = False

App.Options.WithGenerationLevel = 2

App.Options.TimeToActivateWinAfterPoint = 500

App.Options.WindowsApps.NonUniqueListItemRecordMode = “ByName”

App.Options.WindowsApps.RecordOwnerDrawnButtonAs = “PushButtons”

App.Folders.RemoveAll

For more information on the Generate Script button and for information on the options available in the Options, Object Identification, and Test Settings dialog boxes,

Add comment August 22, 2008

Description Object


Description Object

Description object is used to create an empty description object in the script. We can add properties and values to the created object.

Using an empty Description object

Set obj=Description. create

Here “obj” is an empty object and contains no properties. This refers any object in application.

Ex:-

Set obj=Description. create

Set objList=Browser(“micclass:=Browser”).Page(“micclass:=Page”).Childobjects( obj)

Msgbox objList.count ‘Gives Total objects count in the page

Using Description object with properties

Set obj=Description. create

obj(“micclass”).value=”Link”

Now “obj“is a link object and it refers all link objects in application.

Ex:-

1)

Set obj=Description. create

obj(“micclass”).value=”Link”

Set objList=Browser(“micclass:=Browser”).Page(“micclass:=Page”).Childobjects( obj)

Msgbox objList.count ‘Gives Total Link objects count in the page

2)

Set obj=Description. create

obj(“micclass”).value=”Link”

obj(“name”).value=”Login”

Set objList=Browser(“micclass:=Browser”).Page(“micclass:=Page”).Childobjects( obj)

Msgbox objList.count ‘Gives only the link which is having “Login” name

Description object is useful when object properties are changing dynamically or if objects are adding in application dynamically and also to handle the duplicate objects (repeated objects).

4 comments August 21, 2008


Blog Stats

Categories

Recent Posts

 

August 2008
M T W T F S S
« Jul   Sep »
 123
45678910
11121314151617
18192021222324
25262728293031

Archives

Blogroll

Meta