Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
ClickToolbarTool method not working
posted

Hi Ammar,

I am using TestAdvantage 2005 Volume 2 with HP QuickTest Pro scripts. In order to access 'Infragistics.Win.UltraWinToolbars.ButtonTool' I am using ClickToolbarTool method.

But sometime this method does not work. Specially, when script is run on different machines. Even though SwfConfig.xml file shows Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea" mapped to SwfToolBar and Infragistics.QTPServer.WinToolbarsManager.v5.2.dll.

Do we require some other settings need to be checked or is there any workaround for this problem?

Regards,

Mayank

Parents
  • 45
    posted

    I use this method in TestComplete to click on toolbar tools.

     

    function ClickToolButton(toolbarsManager, toolBarKey, buttonKey)
    {
    try
    {
    var toolbar = toolbarsManager.Toolbars.GetItem_2(toolBarKey);
    var button = toolbar.Tools.GetItem_2(buttonKey);
    var x = button.Bounds.X + button.Bounds.Width / 2;
    var y = button.Bounds.Y + button.Bounds.Height / 2;

    Sys.Desktop.MouseDown(VK_LBUTTON, x, y);
    Sys.Desktop.MouseUp(VK_LBUTTON, x, y);

    Log["Event"]("The '" + buttonKey + "' button from the '" + toolBarKey + "' toolbar is clicked");
    }
    catch(ex)
    {
    Log["Error"]("Failed to click tool button " + buttonKey + " on toolbar " + toolBarKey, ex["description"]);
    }
    }
    
    
    Essentially all it does is acquires the bounds of the tool you want to click.  
    Then determines the screen position of it and clicks that area on the screen.

Reply Children
No Data