Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
425 views
by Expert (572 points)
retagged by
I am using TestComplete for my automation works. I have a scenario where when I filter sorting method, it sorts cards based on the date. How do I assert this?

1 Answer

0 like 0 dislike
by

While testing header controls, you can use specific properties and methods of the corresponding program object to perform certain actions and obtain data stored in controls. You can call these methods and properties from your keyword tests, as well as from scripts. This topic describes how to work with the needed properties and methods from your scripts. However, when testing a control from your keyword test, you can use the same methods and properties calling them from keyword test operations. For more information, see Keyword Tests Basic Operations.

A header item can display an up or down arrow that indicates that the content of the related control is sorted by this column. When testing a header control, you may need to determine whether an item has an arrow or set the up or down arrow for the needed column. To let you work with header controls, TestComplete provides the Win32Header object. This object is automatically associated with all header controls whose class names are listed in the Object Mapping list of the current project’s options.

You can check whether an item has an arrow or set an arrow via the wSort property. This property returns 0 if the specified item does not have any arrows, 1 if the specified item shows the up arrow, and 2 if the specified item shows the down arrow.

Another way to set an arrow is to click on the needed header item. There are two types of actions that allow you to simulate a click:

  • Click, DblClick, and similar actions that correspond to the tested header control. When using these actions, you should specify the control-related coordinates. Before specifying the coordinates you can determine the bounds of the needed item as it is described in Determining Header Items' Bounds.
  • ClickItem, ClickItemR and similar actions that correspond to the header items. You should specify the needed item by its index or caption.

To determine whether the needed item has an arrow, use the IsSortDown and IsSortUp properties of the Win32HeaderItemFormat object. For detailed information on how to work with Win32HeaderItemFormat, see Determining Header Items' Format Settings.

The following code snippet obtains information about the first header item. If the item already has an arrow, it posts the arrow type to the test log.

src: https://support.smartbear.com/testcomplete/docs/app-objects/specific-tasks/standard/header/sorting-content.html


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...