Hi,
Thanks in advance.
We are using qtp 9 and trying to click on a toolbar button in the ultratoolbar.
We used .NET spy and were able to see some properties like Enabled = true.for all the buttons..
But we are not able to change any value in them.
Is there any way we can click the button in the ultra tool bar.
There are some 8 buttons and we want to clcik on the first button.
We planned to disable the other buttons and keep the first button enabled and use the firevent click in the .net spy for toolbarmanager.
Since we are not able to set the enabled property to false,it is not working for us.
Please help us in this.
Thanks,
Kala
This sounds like it may be a bug, but I am unable to reproduce it, do you have a sample application that demonstrates this happening. Also out of curiosity for the found sToolBarKeyand sToolKey, how do they differ from what was recorded?
Ok. I have found an answer to my issue detailed above of performing a click on a tool item in a toolbar dock area object. Hopefully, this helps someone.
sExpToolText = lcase(trim(replace(sInputValue," ", ""))) 'Get the number of toolbars within the dock area' iNumToolBars = objToolBarDockArea.ToolbarsManager.Toolbars.Count bToolFound = False For iToolBar = 0 to iNumToolBars - 1 Set objToolBar = objToolBarDockArea.ToolbarsManager.Toolbars.GetItem(iToolBar) sToolBarKey = objToolBar.Key Set objTools = objToolBar.Tools iNumTools = objTools.Count For iToolItem = 0 to iNumTools - 1 sToolKey = lcase(trim(objTools.GetItem(iToolItem).Key)) IF qa_eval_condition(sToolKey,sExpToolText, "equals") = True then sToolKey = objTools.GetItem(iToolItem).Key bToolFound = True Exit For End if Next If bToolFound = True then Exit For Next Set objToolBar = nothing Set objTools = nothing If bToolFound = False then SetErrVariables micFail, "Expected ToolBar item: " & sInputValue & " is not found." else oInputObject.ClickToolbarTool sToolBarKey, sToolKey End If
I have a similar issue described above. NetAdvantage - 10.3 TestAdvantage 2010 vol 3.
QTP records the following interaction.
SwfToolbar("_FXCashLadderControl_Toolbars_").PerformToolAction tbmgrToolbar, tbmgrClick, "FX", "AddMultiFXTrades"
However, it cannot play it back.
The toolbar in question is of type - Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea
.GetItemsCount and .GetContent return an empty string.
I am able to get the caption of a control by passing in an index. .GetItem(0) will give me back the correct caption of the tool.
Can you please suggest a way to perform a click on a tool in this toolbar?
Hi Kshireesh,
Perhaps my answer was a bit misleading, in that the Action would change depending on what version of NetAdvantage that you had. The functionality of the Toolbars Manager increased in each subsequent release of NetAdvantage. Early on there were just normal toolbars, then they expanded to include Ribbons, Application Menu, MiniToolbars, NavigationToolbars, etc. These are all different styles of toolbars that can possibly co-exist, on one form. As they can co-exist on one form, and the same tool can exist on each style of Toolbar, the separate actions were necessary to identify what exact tool you were interacting with. Perhaps if you gave me some insight into what version of NetAdvantage that you are using, if you are using the corresponding version of TestAdvantage, ie if your application uses NetAdvantage 2007 Volume 3, are you using TestAdvantage 2007 Volume 3, and maybe describe or include a picture of the tool that you are trying to interact with. Also when in doubt, what action if any is recorded if you use QTP to record against the application.
did you guys find the solution i tried All of the below and could not click on the Tool inside toolbar
All versions of Net/Test Advantage
Normal Toolbar - ClickToolbarTool(oToolbar, oTool)
Net/Test Advantage 2007 Volume 3
Navigation Toolbar - ClickNavToolbarTool(oTool)