Checking Web Objects - WinRunner

You can use GUI checkpoints in your test scripts to help you check the behavior of Web objects in your Web site. You can check frames, tables, cells, links, and images on a Web page for differences between test runs. You can define GUI checkpoints according to default properties recommended by WinRunner, or you can define custom checks by selecting other properties.

You can also add text checkpoints in your test scripts to read and check text in Web objects and in areas of the Web page.

You can create checkpoints for:

  • Checking Standard Frame Properties
  • Checking the Object Count in Frames
  • Checking the Structure of Frames, Tables, and Cells
  • Checking the Content of Frames, Cells, Links, or Images
  • Checking the Number of Columns and Rows in a Table
  • Checking the URL of Links
  • Checking Source or Type of Images and Image Links
  • Checking Color or Font of Text Links
  • Checking Broken Links
  • Checking Links and Images in a Frame
  • Checking the Text Content of Tables
  • Checking Cells in a Table
  • Checking Text

Checking Standard Frame Properties

You can create a GUI checkpoint to check standard properties of a frame.

To check standard frame properties

  1. Choose Insert > GUI Checkpoint > For Object/Window
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click an object on your Web page. The Check GUI dialog box opens, and the object is highlighted.
  4. To check standard frame properties

  5. In the Objects column, make sure that the frame is selected.
  6. The Properties column indicates the available standard properties and the default check for that frame.

  7. In the Properties column, choose the properties you want WinRunner to check.
  8. You can check the following standard properties:

    • Enabled checks whether the frame can be selected.
    • Focused checks whether keyboard input will be directed to this frame.
    • Label checks the frame’s label.
    • Minimizable and Maximizable check whether the frame can be minimized or maximized.
    • Minimized and Maximized check whether the frame is minimized or maximized.
    • Resizable checks whether the frame can be resized.
    • SystemMenu checks whether the frame has a system menu.
    • Width and Height check the frame’s width and height, in pixels.
    • X and Y check the x and y coordinates of the top left corner of the frame
  9. OK to close the dialog box.

WinRunner captures the object information and stores it in the test's expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as a win_check_gui statement.

Checking the Object Count in Frames

You can create a GUI checkpoint to check the number of objects in a frame.

To check the object count in a frame:

  1. Choose Insert > GUI Checkpoint > For Object/Window.
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click an object on your Web page. The Check GUI dialog box opens, and the object is highlighted.
  4. To check the object count in a frame

  5. In the Objects column, make sure that the frame is selected.The Properties column indicates the properties available for you to check.
  6. In the Properties column, select the CountObjects check box
  7. To edit the expected value of the property, highlight CountObjects.

    Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. A spin box opens.

    Enter the expected number of objects.

  8. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test’s expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as a win_check_gui statement.

Checking the Structure of Frames, Tables, and Cells

You can create a GUI checkpoint to check the structure of frames, tables, and cells on a Web page.

To check the structure of a frame, table, or cell

  1. Choose Insert > GUI Checkpoint > For Object/Window.
    The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.
  2. Double-click an object on your Web page. The Check GUI dialog box opens, and the object is highlighted.
  3. To check the structure of a frame, table, or cell

  4. In the Objects column, select an object.The Properties column indicates the properties available for you to check.
  5. In the Properties column, select the Format check box
  6. To edit the expected value of the property, highlight Format.
  7. Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. A text file opens in Notepad describing the structure of the frame, table, or cell.

    Modify the expected structure.

    Save the text file and close Notepad.

  8. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test’s expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as an obj_check_gui or win_check_gui statement.

Checking the Content of Frames, Cells, Links, or Images

You can create a GUI checkpoint to check the content of a frame, cell, text link, image link, or an image. To check the content of a table, see “Checking the Text Content of Tables”

To check content

  1. Choose Insert > GUI Checkpoint > For Object/Window.
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click an object on your Web page. The Check GUI dialog box opens, and the object is highlighted.
  4. To check content

  5. In the Objects column, select an object (frame, cell, text link, image link, or an image).The Properties column indicates the properties available for you to check.
  6. In the Properties column, select one of the following checks:
    • If your object is a frame, select the FrameContent check box.
    • If your object is a cell, select the CellContent check box.
    • If your object is a text link, select the Text check box.
    • If your object is an image link, select the ImageContent check box.
    • If your object is an image, select the ImageContent check box.
  7. To edit the expected value of a the property, highlight a property.

    Note that you cannot edit the expected value of the ImageContent property.

    Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it.

  8. For the FrameContent property, an editor opens.
  9. For the CellContent property, an editor opens.
  10. For the Text property, an edit box opens.
  11. Modify the expected value.
  12. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test’s expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as an obj_check_gui orwin_check_gui statement.

Checking the Number of Columns and Rows in a Table

You can create a GUI checkpoint to check the number of columns and rows in a table.

To check the number of columns and rows in a table

  1. Choose Insert > GUI Checkpoint > For Object/Window.
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click a table on your Web page. The Check GUI dialog box opens, and the object is highlighted.
  4. To check the number of columns and rows in a table

  5. In the Objects column, make sure the table is selected.
  6. The Properties column indicates the properties available for you to check.

  7. In the Properties column, select the Columns and/or Rows check box.
  8. To edit the expected value of a property, highlight Columns or Rows.

    Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. A spin box opens.

    Edit the expected value of the property, as desired.

  9. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test’s expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as an obj_check_gui orwin_check_gui statement.

Checking the URL of Links

You can create a GUI checkpoint to check the URL of a text link or an image link in your Web page.

To check the URL of a link:

  1. Choose Insert > GUI Checkpoint > For Object/Window.
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click a text link on your Web page. The Check GUI dialog box opens, and the object is highlighted.
  4. To check the URL of a link

  5. In the Objects column, make sure that link is selected.The Properties column indicates the properties available for you to check.
  6. In the Properties column, select URL to check address of the link.
  7. To edit the expected value of the URL property, highlight URL.
  8. Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. An edit box opens.

    Edit the expected value.

  9. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test’s expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as an obj_check_gui statement.

Checking Source or Type of Images and Image Links

You can create a GUI checkpoint to check the source and the image type of an image or an image link in your Web page.

To check the source or type of an image or an image link:

  1. Choose Insert > GUI Checkpoint > For Object/Window.
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click an image or image link on your Web page. The Check GUI dialog box opens, and the object is highlighted.
  4. To check the source or type of an image or an image link

  5. In the Objects column, make sure that the image or the image link is selected.
  6. The Properties column indicates the properties available for you to check.

  7. In the Properties column, select a property check.
    • Source indicates the location of the image.
    • Type indicates whether the object is a plain image, an image link, or an image map.
  8. To edit the expected value of the property, highlight a property.
  9. Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. An edit box opens.

    Edit the expected value.

  10. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test’s expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as an obj_check_gui statement.

Checking Color or Font of Text Links

You can create a GUI checkpoint to check the color and font of a text link in your Web page.

To check the color or font of a text link:

  1. Choose Insert > GUI Checkpoint > For Object/Window.
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click a text link on your Web page. The Check GUI dialog box opens, and the object is highlighted.
  4. To check the color or font of a text link

  5. In the Objects column, make sure that the text link is selected.
    The Properties column indicates the properties available for you to check
  6. In the Properties column, select a property check.
    • BackgroundColor indicates the background color of a text link.
    • Color indicates the foreground color of a text link.
    • Font indicates the font of a text link.
  7. To edit the expected value of a property, highlight a property.
  8. Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. A box opens.

    Edit the expected value.

  9. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test’s expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as an obj_check_gui statement.

Checking Broken Links

You can create a checkpoint to check whether a text link or an image link is active. You can create a checkpoint to check a single broken link or all the broken links in a frame.

To check a single broken link:

  1. Choose Insert > GUI Checkpoint > For Object/Window.

    The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  1. Double-click a link on your Web page. The Check GUI dialog box opens, and the object is highlighted.
  2. To check a single broken link

  3. In the Objects column, make sure that the link is selected.
  4. The Properties column indicates the properties available for you to check.

  5. In the Properties column, select the BrokenLink check box.
  6. To edit the expected value of the property, highlight BrokenLink.
  7. Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. A combo box opens. Select Valid or NotValid. Valid indicates that the link is active, and NotValid
    indicates that the link is broken.

  8. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test’s expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as an obj_check_gui orwin_check_gui statement.

To check all broken links in a frame:

  1. Choose Insert > GUI Checkpoint > For Object/Window.
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click an object on your Web page. The Check GUI dialog box opens, and an object is highlighted.
  4. To check all broken links in a frame

  5. In the Objects column, make sure that frame is selected.
  6. The Properties column indicates the properties available for you to check.

  7. In the Properties column, select the BrokenLinks check box.
  8. To edit the expected value of the property, highlight BrokenLinks.
  9. Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. The Edit Check dialog box opens.

    You can specify which links to check, and which verification method and verification type to use. You can also edit the expected data. For additional information on using this dialog box, see “Checking Cells in a Table”

    When you are done, click OK to save and close the Edit Check dialog box. The Check GUI dialog box is restored.

  10. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test’s expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as a win_check_gui statement.

Checking Links and Images in a Frame

You can create a checkpoint to check image links, text links and images in a frame.

To check links and images in a frame:

  1. Choose Insert > GUI Checkpoint > For Object/Window.
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click an object on your Web page. The Check GUI dialog box opens, and an object is highlighted.
  4. To check links and images in a frame

  5. In the Objects column, make sure that frame object is selected.
    The Properties column indicates the properties available for you to check.
  6. In the Properties column, select one of the following checks:
    • To check images or image links, select the Images check box.
    • To check text links, select the Links check box.
  7. To edit the expected value of the property, highlight Images.
  8. Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. The Edit Check dialog box opens.

    You can specify which images or links to check in the table, and which verification method and verification type to use. You can also edit the expected data.When you are done, click OK to save and close the Edit Check dialog box.
    The Check GUI dialog box is restored.

  9. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test's expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as a win_check_gui statement.

Checking the Text Content of Tables

You can create a checkpoint to check the text content of a table.

To check the content of a table:

  1. Choose Insert > GUI Checkpoint > For Object/Window.
  2. The WinRunner window is minimized to an icon, the mouse pointer turns into a pointing hand, and a help window opens.

  3. Double-click a table on your Web page. The Check GUI dialog box opens, and an object is highlighted.
  4. To check the content of a table

  5. In the Objects column, make sure that the table is selected.
  6. The Properties column indicates the properties available for you to check.

  7. In the Properties column, select the TableContent check box.
  8. To edit the expected value of the property, highlight TableContent
  9. Click the Edit Expected Value button, or double-click the value in the Expected Value column to edit it. The Edit Check dialog box opens.

    You can specify which column or rows to check in the table, and which verification method and verification type to use. You can also edit the expected data.

    When you are done, click OK to save and close the Edit Check dialog box.
    The Check GUI dialog box is restored.

  10. Click OK to close the Check GUI dialog box.

WinRunner captures the object information and stores it in the test's expected results folder. The WinRunner window is restored and a checkpoint appears in your test script as a win_check_gui statement.

Checking Cells in a Table

The Edit Check dialog box enables you to specify which cells in a table to check, and which verification method and verification type to use. You can also edit the expected data for the table cells included in the check.

Checking Cells in a Table

In the Select Checks tab, you can specify the information that is saved in the GUI checklist:

  • which table cells to check
  • the verification method
  • the verification type

Note that if you are creating a check on a single-column table, the contents of the Select Checks tab of the Edit Check dialog box differ from what is shown above.

Specifying which Cells to Check

The List of checks box displays all the checks that will be performed, including the verification type. When the Edit Check dialog box is opened for the first time for a checkpoint, the default check is displayed:

  • The default check for a multiple-column table is a case sensitive check on the entire table by column name and row index.
  • The default check for a single-column table is a case sensitive check on the entire table by row position.

If you do not wish to accept the default settings, you must delete the default check before you specify the checks to perform. Select the “Entire Table - Case Sensitive check” entry in the List of Checks box and click the Delete button. Alternatively, double-click this entry in the List of Checks box. A WinRunner message prompts you to delete the highlighted check. Click Yes.

Next, specify the checks to perform. You can choose different verification type for different selections of cells. Therefore, specify the verification type before selecting cells.

Highlight the cells on which you want to perform the content check. Next, click the Add button toolbar to add a check for these cells. Alternatively, you can:

  • double-click a cell to check it
  • double-click a row header to check all the cells in a row
  • double-click a column header to check all the cells in a column
  • double-click the top-left corner to check the entire table

A description of the cells to be checked appears in the List of Checks box.

Specifying the Verification Method

You can select the verification method to control how WinRunner identifies columns or rows within a table. The verification method applies to the entire table. Specifying the verification method is different for multiplecolumn and single-column tables.

Specifying the Verification Method for a Multiple-Column Table

  • Name: WinRunner looks for the selection according to the column names. A shift in the position of the columns within the table does not result in a mismatch.
  • Index: WinRunner looks for the selection according to the index, or position, of the columns. A shift in the position of the columns within the table results in a mismatch. Select this option if your table contains multiple columns with the same name. Choosing this option enables the Verify column headers check box, which enables you to check column headers as well as cells.
  • Key: WinRunner looks for the rows in the selection according to the data in the key column(s) specified in the Select key columns list box. For example, you could tell WinRunner to identify the second row in the table based on the arrival time for that row. A shift in the position of the rows does not result in a mismatch. If the key selectiondoes not uniquely identify a row, WinRunner checks the first matching row. You can use more than one key column to uniquely identify the row.
  • Index (default setting): WinRunner looks for the selection according to the index, or position, of the rows. A shift in the position of any of the rows results in a mismatch.

Specifying the Verification Method for a Single-Column Table

The Verification methods box in the Select Checks tab for a single-column table is different from that for a multiple-column table. The default check for a single-column table is a case sensitive check on the entire table by row position.
Specifying the Verification Method for a Single-Column Table

  • By position: WinRunner checks the selection according to the location of the items within the column.
  • By content: WinRunner checks the selection according to the content of the items, ignoring their location in the column.

Specifying the Verification Type

WinRunner can verify the contents of a table in several different ways. You can choose different verification types for different selections of cells.

  • Case Sensitive (the default): WinRunner compares the text content of the selection. Any difference in case or text content between the expected and actual data results in a mismatch.
  • Case Insensitive: WinRunner compares the text content of the selection. Only differences in text content between the expected and actual data result in a mismatch.
  • Numeric Content: WinRunner evaluates the selected data according to numeric values. WinRunner recognizes, for example, that “2” and “2.00” are the same number.
  • Numeric Range: WinRunner compares the selected data against a numeric range. Both the minimum and maximum values are any real number that you specify. This comparison differs from text and numeric content verification in that the actual table data is compared against the range that you defined and not against the expected results.
  • Case Sensitive Ignore Spaces: WinRunner checks the data in the cell according to case and content, ignoring differences in spaces. WinRunner reports any differences in case or content as a mismatch.
  • Case Insensitive Ignore Spaces: WinRunner checks the content in the cell according to content, ignoring differences in case and spaces. WinRunner reports only differences in content as a mismatch.

Click OK to save your changes to both tabs of the Edit Check dialog box. The dialog box closes and the Check GUI dialog box is restored.

Editing the Expected Data

To edit the expected data in the table, click the Edit Expected Data tab. If you previously saved changes in the Select Checks tab, you can click Reload Table to reload the table selections from the checklist. A WinRunner message prompts you to reload the saved data. Click Yes.

Note that if you previously saved changes to the Select Checks tab, and then reopened the Edit Check dialog box, the table appears color coded in the Edit Expected Data tab. The cells included in the check appear in blue on a white background. The cells excluded from the check appear in green on a yellow background.

Editing the Expected Data

To edit the expected value of data in a cell, double-click inside the cell. A cursor appears in the cell. Change the contents of the cell, as desired. Click OK to save your changes to both tabs of the Edit Check dialog box. The dialog box closes and the Check GUI dialog box is restored.

Checking Text

You can use text checkpoints in your test scripts to read and check text in Web objects and in areas of the Web page. While creating a test, you point to an object or a frame containing text. WebTest reads the text and writes a TSL statement to the test script. You may then add simple programming elements to your test scripts to verify the contents of the text.

You can use a text checkpoint to:

  • read a text string or all the text from a Web object or frame, using web_obj_get_text or web_frame_get_text
  • check that a text string exists in a Web object or frame, using web_obj_text_exists or web_frame_text_exists

Reading All the Text in a Frame or an Object

You can read all the visible text in a frame or an object using web_obj_get_text or web_frame_get_text.

To read all the text in a frame or an object:

  1. Choose Insert > Get Text > From Object/Window.
  2. WinRunner is minimized, the mouse pointer becomes a pointing hand, and a help window opens.

  3. Click the Web object or the frame.

WinRunner captures the text in the object and a web_obj_get_text or a web_frame_get_text statement is inserted in your test script.

Reading a Text String from a Frame or an Object

You can read a text string from a frame or an object using the web_obj_get_text or web_frame_get_text function.

To read a text string from a frame or an object:

  1. Choose Insert > Get Text > From Selection (Web only).
  2. WinRunner is minimized, the mouse pointer becomes a pointing hand, and a Help window opens.

  3. Highlight the text string to be read.
  4. On the highlighted text string, right-click the mouse button to capture the string. The Specify Text dialog box opens.
  5. To read a text string from a frame or an object

    The text string to be read is displayed in green. The red text that is displayed on the left and right of your selection, defines the bounds of the string.

  6. You can modify your text selections.
    • To modify your highlighted text selection, highlight a new text string and click New Text.
  7. Your new text selection is displayed in green. The text that appears before and after your text string is displayed in red.

    • To modify the red text string that appears to the left of your selection, highlight a new text string and click Text Before.
    • To modify the red text string that appears to the right of your selection, highlight a new text string and click Text After.
  8. Click OK to close the Specify Text dialog box.

The WinRunner window is restored and a web_obj_get_text or a web_frame_get_text statement is inserted in your test script.

Checking that a Text String Exists in a Frame or an Object

You can check whether a text string exists in an object or a frame using web_obj_text_exists oweb_frame_text_exists.

To check that a text string exists in a frame or an object:

  1. Choose Insert > Get Text > Web Text Checkpoint.
  2. WinRunner is minimized, the mouse pointer becomes a pointing hand, and a help window opens.

  3. Highlight the text string to be checked.
  4. On the highlighted text string, right-click the mouse button to capture the string. The Specify Text dialog box opens.
  5. To check that a text string exists in a frame or an object

    The text string to be checked is displayed in green. The red text that is displayed on the left and right of your selection defines the bounds of the string.

  6. You can modify your text selections.
    • To modify your highlighted text selection, highlight a new text string and click New Text.
  7. Your new text selection is displayed in green. The text that is displayed before and after your text string is displayed in red.

    • To modify the red text string that is displayed to the left of your selection, highlight a new text string and click Text Before.
    • To modify the red text string that is displayed to the right of your selection, highlight a new text string and click Text After.
  8. Click OK to close the Specify Text dialog box.

The WinRunner window is restored and a web_obj_text_exists or a web_frame_text_exists statement is inserted in your test script.


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

WinRunner Topics