Retrieve data from an application
From Seapine Labs
One of the tasks that you may frequently perform is retrieving live data from an application or Web page, for use later in the script.
In QA Wizard, this was accomplished using a checkpoint in conjunction with the RUNTIME function. QA Wizard Pro has taken a different approach to this step. (Don't worry, QA Wizard Pro still has checkpoints. They are now used to check data and not to retrieve data.)
QA Wizard Pro includes a built-in function, called getControlData, that returns the value of a property. Following is the syntax:
This function includes three arguments:
To find the available properties for an object, select it in the application repository, right-click, and choose Properties from the context menu.
This function returns the data for the specified property, which can then be assigned to a local variable in the script or used as the parameter for another function.
You have a Web page with a hyperlink that you want to find the text for and store in a local variable named LinkText. The hyperlink is named "hyperlink1" in the application repository and is a child of the "Wysicorp - Home Page" Window. After you find the text, you want to click the link and make sure the title of the page that gets loaded is the title ("Wysicorp - " + LinkText).
LinkText = getControlData("Wysicorp - Home Page", "hyperlink1", "Inner Text")