Forum Discussion

cagraff's avatar
cagraff
New Contributor
16 years ago

Infragistics and Recorded Test using mouse click coordinates


Hi,


We own testcompete 5 and I am considering upgrading to 7.52.


In evaluating I am tring to record a script (tried both keyword and script mode) and since Infrgistics is supported I would expect selecting a treeview menu item NOT to require mouse click coordinates and instead use clickitem. The coordinates make the tests very brittle.


Below is a small recorded test that shows this.

I expected this :

  epiTreeView.Click(48, 74);

to be more like this as shown below:

  ultraToolbarsDockArea.ClickItem("Standard Tools|[1]|New Part Class");



Do I need to manually script or do I need to do some object mapping or is it just not working as expected? In some cases it seems smart enough to use click item and in others it uses X/Y coordinates.


Here is the code:

-------------------

function Test2()

{

  var  mfgSys;

  var  logOn;

  var  embeddableTextBoxWithUIPermissions;

  var  menuForm;

  var  epiTreeView;

  var  partClassForm;

  var  partClassDetailPanel;

  var  basicSearchForm;

  var  epiPanel;

  var  ultraToolbarsDockArea;

  TestedApps.MfgSys.Run(1, true);

  mfgSys = Aliases.MfgSys;

  logOn = mfgSys.LogOn;

  menuForm = mfgSys.MenuForm;

  epiTreeView = menuForm.windowDockingArea1.dockableWindow1.systemMenu.ultraExplorerBarContainerControl1.treeView;

  epiTreeView.Click(48, 74);

  epiTreeView.DblClick(95, 108);

  menuForm.windowDockingArea2.dockableWindow3.listView.DblClick(44, 168);

  partClassForm = mfgSys.PartClassForm;

  partClassDetailPanel = partClassForm.windowDockingArea2.dockableWindow8.mainPanel1.windowDockingArea1.dockableWindow1.partClassDetailPanel1;

  partClassDetailPanel.btnClass.Click(79, 15);

  basicSearchForm = mfgSys.BasicSearchForm;

  epiPanel = basicSearchForm.windowDockingArea1.dockableWindow1.pnlSearchCrit;

  epiPanel.panel1.oETC.oETP.pnlBasicSrch.groupBox1.txtStartWith.EmbeddableTextBoxWithUIPermissions.Click(31, 15);

  epiPanel.btnSearch.Click(51, 12);

  basicSearchForm.ultraStatusBar2.btnOK.Click(77, 9);

  ultraToolbarsDockArea = partClassForm.zPartClass_Toolbars_Dock_Area_Top;

  ultraToolbarsDockArea.ClickItem("Standard Tools|[1]");

  ultraToolbarsDockArea.ClickItem("Standard Tools|[1]|New Part Class");

  embeddableTextBoxWithUIPermissions = partClassDetailPanel.txtClass.EmbeddableTextBoxWithUIPermissions;

  embeddableTextBoxWithUIPermissions.wText = "cag";

  embeddableTextBoxWithUIPermissions.Keys("[Tab]");

}


7 Replies

  • cagraff's avatar
    cagraff
    New Contributor
    I can see methods associated with the menu treeview object as shown in this attachment. Perhaps I can create a JScript function that calls a method on this object to select menu items by name?

    Psuedo Code:



    function getMenuItem(name)

      menu = <instantatiate object>

      curent = menu.findchild(name)

      current.click

    end



    Something like that anyway - as I think I only need to do this on the main menu tree and everything else seems to be OK.











  • Hi Carl,





    >> epiTreeView.Click(48, 74);

    Is the epiTreeView control a custom one? 





    Please let us know its ClrFullClassName property value, vendor and version.
  • Even if this post is some years old I would like to ask for the answer. I have the same problem now. I have a treemenu with some items, which i can expand by mouseclick. Each of the items has other items. Some of thise second items can be expanded too.

    The first items i can expand with :  

    Aliases.WWSWin.MainForm.windowDockingArea1.dockableWindow1.outlookMenu.explorerBar.ExpandGroup("name");



    II tried to find teh valuesyou were asking for but I wasn't able to find them. Hope you can help me.



  • I think it is a normal tree menu.

    This is its full name found by the object spy



    Sys.Process("WWSWin").WinFormsObject("MainForm").WinFormsObject("windowDockingArea1").WinFormsObject("dockableWindow1").WinFormsObject("outlookMenu").WinFormsObject("explorerBar").WinFormsObject("UltraExplorerBarContainerControl", "", 2).WinFormsObject("TreeMenuControl", "")

  • Hi Patrick,


     


    How does TestComplete record an action with the menu? Can you post here a recorded script?


     

  •  //Expends Auftragsentwicklung  Aliases.WWSWin.MainForm.windowDockingArea1.dockableWindow1.outlookMenu.explorerBar.ExpandGroup("Auftragsabwicklung");



      //Expends a subitem of Auftragsabwicklung  Aliases.WWSWin.MainForm.windowDockingArea1.dockableWindow1.outlookMenu.explorerBar.UltraExplorerBarContainerControl.TreeMenuControl.Click(69, 28);