Search:     Advanced search

Adding HTML Elements to the Application Repository

Article ID: 793  |  Last updated: 20 Mar, 2015

When testing web pages, QA Wizard Pro captures controls, such as hyperlinks and buttons, but it does not capture the actual page text. In most cases, this is not an issue. If you want to verify specific text, such a confirmation number, you must first capture the HTML element that contains the text by using a checkpoint. Use the following steps to capture an HTML element.

  1. Record a new script or new steps into an existing script.
  2. Interact with the web site to open the page containing the HTML element you want to capture.
  3. When the element appears, click the Checkpoint button on the Recording toolbar.
  4. Click the element.
  5. Click the Checkpoint button again.
  6. Click Stop. QA Wizard Pro adds the element to the application repository.
  7. After the element is added, you can use the Property function to retrieve and validate information.

The following example retrieves a ticket number from a confirmation web page.

1  ' Window("WysiCorp Thank You").HTMLElement("Ticket").Checkpoint("Inner Text","W98038", True, "")
2  TicketNum = Window("WysiCorp Thank You").HTMLElement("Ticket").Property("Inner Text")
3  If TicketNum = "" then
4     Fail("Could not find the ticket number")
5  Else
6     PrintLn("The ticket number is " & ticketNum)
7  End If

Line 1 contains the checkpoint used to capture the HTML element that stores the confirmation number. After using the checkpoint to capture the element in the application repository, you can comment the checkpoint out or delete it. (Because the web site generates a new ticket number for each item submitted, the checkpoint will fail after the initial recording.) Line 2 saves the confirmation number in a variable named TicketNum. Lines 3 through 7 evaluate the TicketNum and print the confirmation number if it exists. If the site does not generate a confirmation number the script fails.

Note: If you want to verify information stored in running HTML text (not in a specific element) see Capturing Web Page Text with QA Wizard Pro Functions.

Article ID: 793  |   Last updated: 20 Mar, 2015
application repository HTML elements

Prev   Next
Silverlight Applications Crash in Firefox When Recording or...     Scripts Testing WPF Controls Fail After Upgrading to QA Wizard...