Hello,
I need some guidance on how to click a button on a tool bar. I can pull the button names but I am having a hard time with how to actually click a button. Some advice would be great.
Here is what I have working:
strToolName = SwfWindow("PRISM G2").SwfToolbar("_ProjectManagerWindow_Toolbars").GetNAProperty ("Ribbon.Tabs[2].Groups[0].Tools[0]")
print strToolName
result = ' = [Cost Control Accounts] - ButtonTool
Cost Control Accounts is a button I would like to push to open another form.
Here are 3 different attemps:
SwfWindow("PRISM G2").SwfToolbar("_ProjectManagerWindow_Toolbars").ClickToolbarTool "_ProjectManagerWindow_Toolbars", "Cost Control Accounts"
'SwfWindow("PRISM G2").SwfToolbar("_ProjectManagerWindow_Toolbars").Press "_ProjectManagerWindow_Toolbars", "Cost Control Accounts"
SwfWindow("PRISM G2").SwfToolbar("_ProjectManagerWindow_Toolbars").Press ("Ribbon.Tabs[2].Groups[0].Tools[0]")
Error from the last:
'Cannot identify the specified item of the _ProjectManagerWindow_Toolbars object. Confirm that the specified item is included in the object's item collection.''Line (87): "SwfWindow("PRISM G2").SwfToolbar("_ProjectManagerWindow_Toolbars").Press ("Ribbon.Tabs[2].Groups[0].Tools[0]")".
Any help would be greatly appreciated.
I am having similar problems using UltraToolbarsDockArea in testadvantage version free, qtp11
recording bring this code
SwfWindow("MainReport").SwfToolbar(“MenuBar").PerformToolAction tbmgrToolbar, tbmgrDropDown, "MainMenu52", "3"
SwfWindow("MainReport").SwfToolbar(“MenuBar").PerformToolAction tbmgrMenu, tbmgrDropDown, "MainMenu52,3", "13"
SwfWindow("MainReport").SwfToolbar(“MenuBar").PerformToolAction tbmgrMenu, tbmgrClick, "MainMenu52,3,13", "19"
but it does not replay
are there any other methods?
It turns out the code QTP recorded was not consistent and therefore didnt work, using the value of the enum from TestAdvantage.QTPServer.TypeInformation.xml and the testadvantage help file, I was finally able to select using this code instead
SwfWindow("MainReport").SwfToolbar(“MenuBar").PerformToolAction 103, 509, "MainMenu52", "3"
SwfWindow("MainReport").SwfToolbar(“MenuBar").PerformToolAction 103, 509, "MainMenu52","3,13"
SwfWindow("MainReport").SwfToolbar(“MenuBar").PerformToolAction 103, 503, "MainMenu52","3,13,19"
Good luck
I'm glad it works now.
Amitai,
I am going to try to reproduce this issue on my end. Which version of TestAdvantage and NetAdvantage are you using?
We have 10.3 CLR2 but are using the version free assemblies