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.
Hi ,
I want to select the menu.
I am able to spy upto following hierarchy:
SwfWindow("swfwin_PDMSDesign").SwfToolbar("swftb_PDMSDesign_Toolbar")
If i want to select menu View ->Look , if am recording it then i am getting following code:-
SwfWindow("swfwin_PDMSDesign").SwfToolbar("swftb_PDMSDesign_Toolbar").PerformToolAction tbmgrToolbar, tbmgrDropDown, "MainMenuBar", "!!APPDESMAIN.BAR.COREVIEWMENU" SwfWindow("swfwin_PDMSDesign").SwfToolbar("swftb_PDMSDesign_Toolbar").PerformToolAction tbmgrMenu, tbmgrDropDown, "MainMenuBar,!!APPDESMAIN.BAR.COREVIEWMENU", "!!APPDESMAIN.COREVIEWMENU.**11"
I want to select menu by function.
Please help me to know which methoda to use and which arguments to pass.
I have a feeling the install of TestAdvantage may have been slightly flawed. Try putting quotes around the tbmgrRibbonTab and tbmgrClick. The reason being, a number of releases ago, we started using QTP version of enumerations called ListOfValues. In the install it builds those ListOfValues for you and when QTP sees them they translate the values into Int16 values that we our methods understand. If that part of the install fails, then QTP sees the values like tbmgrRibbonTab and tbmgrClick as variables names that are not set, and when it attempts to send it to our actions it dies before it gets to us to throw a clean error message.
Putting quotes around them is a simple test to see if that is the issue. The file not installed properly or not referenced properly is the TypeInformationFile called TestAdvantage.QTPServer.TypeInformation.xml. It needs to be either in a place where QTP knows where to look for the file or a registry entry that tells QTP to look in its current location.
This behavior typically comes up on one of two occasions, a partial manual install where the step to add the registry entry was not done, or during a install scenario where QTP and TestAdvantage were installed back to back without running QTP at least once, before installing TestAdvantage. The help lists the steps to correct it in :
Manually Setting Up TestAdvantage for Windows Forms (for HP QuickTest Professional software) step 4.
Here is the recorded action:
SwfWindow("PRISM G2").SwfToolbar("_ProjectManagerWindow_Toolbars").PerformToolAction tbmgrRibbonTab, tbmgrClick, "Cost Management (Mar '11):Cost", "Cost Control Accounts"
When running the line, it errors out. Error:
Object reference not set to an instance of an object.
Line (82): "SwfWindow("PRISM G2").SwfToolbar("_ProjectManagerWindow_Toolbars").PerformToolAction tbmgrRibbonTab, tbmgrClick, "Cost Management (Mar '11):Cost", "Cost Control Accounts"".