Using Descriptive Programming - WinRunner

When you add an object to the GUI Map, WinRunner assigns it a logical name. Once an object exists in the GUI Map, you can add statements to your test that perform functions on that object. To add these statements, you usually enter the logical name of the object as the object description.

For example, in the statements below, Flight Reservation is the logical name of a window, and File;Open Order is the logical name of the menu.

Because each object in the GUI Map has a unique logical name, this is all you need to describe the object. During the test run, WinRunner finds the object in the GUI Map based on its logical name and uses the other property values stored for that object to identify the object in your application.

You can also add statements to perform functions on objects without referring to the GUI Map. To do this, you need to enter more information in the description of the object in order to uniquely describe the object so that WinRunner can identify the object during the test run. This is known as descriptive programming.

For example, suppose you recorded a purchase order in a flight reservation application. Then, after you created your test, an additional radio button group was added to the purchase order. Rather than recording a new step in your existing test in order to add to the object to the GUI Map, you can add a statement to the script that describes the radio button you want to select, and sets the radio button state to ON.

You describe the object by defining the object class, the MSW_class, and as many additional property:value pairs as necessary to uniquely identify the object.

The general syntax is:

function_name: The function you want to perform on the object.

property:value: The object property and its value. Each property:value pair should be separated by commas.

other_function_parameters: You enter other required or optional function parameters in the statement just as you would when using the logical name for the object parameter.

The entire object description should surrounded by curly brackets and quotes: “{description}”.

For example, the statement below performs a button_set function on a radio button to select a business class airline seat. When the test runs, WinRunner finds the radio button object with matching property values and selects it.”

If you are not sure which properties and values you can use to identify an object, use the GUI Spy to view the current properties and values of the object. For more information, see “Viewing GUI Object Properties”


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

WinRunner Topics