Ask a Question

How to eliminate coordinates

Occasional Contributor

How to eliminate coordinates

TestComplete does not recognize the items of a window in the application I'm testing. To overcome this I added the class name of the window in the text recognition filed under open applications. This works in recognizing the item, but upon recording a script I still do get coordinates along with the ID of the item. Below is the example ;


  var  XTPDockingPaneTabbedContainer = Aliases["matic"]["wndAfx"]["XTPDockingPaneTabbedContainer1"];

  MTopicPageBase = XTPDockingPaneTabbedContainer["pageOperations"]["MTopicPageBase"];

  XTPDockingPaneTabbedContainer["Click"](118, 31);

  MTopicPageBase["Click"](61, 43);

  MTopicPageBase["Create_new_part"]["Click"](67, 5);

  MTopicPageBase["New_part_name"]["Click"](61, 11);

  MTopicPageBase["Remove_original"]["Click"](49, 7);

  MTopicPageBase["b"]["Click"](5, 6);

  MTopicPageBase["b1"]["Click"](4, 4);

How do i remove the coordinates and still be able to run the script succesfully?

Champion Level 3

Hi Divash,

You may just delete coordinates after the script was recorded. In this case TestComplete will perform clicks in the middle of the corresponding control.
  /Alex [Community Champion]
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
Occasional Contributor

Hi Alex,

I have removed the coordinates as below, but when i run the test an error message appears. 

Is there any particular workaround for this ? Attached is also the object browser recognition and property page.

Hi Divash,

Try putting the parentheses after the calls:


Customer Care Manager
Occasional Contributor

Thank you, this helps a lot as I was thinking of how to eliminate coordinates from my scripts.
Occasional Contributor

I'm running into a similar problem.  TC recorded

  all.Item(1038).Click(59, 8);

but when I run the script, I get an out of bounds error.  When I remove the coordinates and leave the parentheses empty, I get the same error for location (0,0).

Hello Davina,

You are likely to have another problem.

First of all, you are testing a web application, this makes a difference. Besides that, you are accessing a page element by ID (1038), while IDs are dynamic and can change from one test run to another. Most probably, the IDs have changed, and now your code refers to a zero-sized page element, and that is why, it can't click it.

To learn more on the matter, see the following FAQ entry:

Also, go through the "Access to Web Pages and Web Page Elements" help topic:

Customer Care Manager
Showing results for 
Search instead for 
Did you mean: