Forum Discussion

divashm's avatar
divashm
Occasional Contributor
15 years ago

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?

6 Replies

  • AlexKaras's avatar
    AlexKaras
    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.
  • divashm's avatar
    divashm
    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.
  • jlui's avatar
    jlui
    Occasional Contributor
    Thank you, this helps a lot as I was thinking of how to eliminate coordinates from my scripts.
  • darmstrong's avatar
    darmstrong
    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:

    http://www.automatedqa.com/support/viewarticle.aspx?aid=8914







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

    http://www.automatedqa.com/support/viewarticle.aspx?aid=6287