Forum Discussion

jyothi_priya's avatar
jyothi_priya
Contributor
13 years ago

How to handle third party controls

Hi,



I have a grid control which is a third party control. This grid has rows and columns. In one of the column, third party check boxes are present. Test Complete recognizes  only the grid not the rows or columns. So I have tried to use following property to tick the checkbox:



Object.Columns.Item(0).Value = 1



My Req is on checking the checkbox, I should get a warning message. As I'm changing the property value this warning msg is getting bypassed and the checkbox is ticked with abrupt halting of application. There is no other property to tick the checkbox.



Can anyone help me how to handle third party controls i.e., is there any way to make TestComplete recognize these objects?

  • HKosova's avatar
    HKosova
    SmartBear Alumni (Retired)
    Without knowing what particular controls are used in your tested application, it's difficult to give any specific advice. Some general suggestions are as follows:



    1. If your grid control is derived from one of the grids supported by TestComplete, you can set up Object Mapping to associate your custom grid with the base grid. In this case, you'll be able to use the ClickCell method to simulate actual clicks on grid cells.



    2. Your grid control may have some native methods and properties for getting cell coordinates given the row and column indexes. In this case, instead of directly setting the cell value, you could calculate coordinates of the target cell with the check box and click on these coordinates to toggle the check box. To find out if the grid has properties and methods for this purpose, explore the grid in the Object Browser, read the grid API documentation or ask the tested application's developers.



    3. You can interact with the grid using the keyboard instead of the mouse. For example, you could use Ctrl+Home, then arrow keys to select the target cell, and then press Space to toggle the check box. (Note that keyboard shortcuts can be different depending on the grid.)



    4. You can enable MSAA, UI Automation or Text Recognition engines for your tested application to improve the object recognition. This may result in TestComplete's identifying more elements inside the grid.



    You can find more info and tips in the following articles:

    About Improving Object Recognition

    Ways to Interact With Application Objects



    Hope this helps!