Hello guys,
Could you please suggest, how can I get access to the toolbar item? Please see below.
In general I need to check if this item sticked or not.
And also, could you please share the link to the PerformToolAction object description (methods, etc)
Thank you in advance!
Hi,
I try to reproduce your scenario. Could you please take a look at the provided code below and attached video file. Let me know if you have any questions.
SwfWindow("Form1").Move 478,148SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrClick, "UltraToolbar1", "ButtonTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrClick, "UltraToolbar1", "StateButtonTool1" SwfWindow("Form1").Move 477,300SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrDropDown, "UltraToolbar1", "PopupMenuTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrMenu, tbmgrClick, "UltraToolbar1,PopupMenuTool1", "ButtonTool2" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrDropDown, "UltraToolbar1", "PopupMenuTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrMenu, tbmgrClick, "UltraToolbar1,PopupMenuTool1", "StateButtonTool2" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrDropDown, "UltraToolbar1", "PopupMenuTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrMenu, tbmgrClick, "UltraToolbar1,PopupMenuTool1", "ButtonTool2" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrClick, "UltraToolbar1", "ButtonTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrClick, "UltraToolbar1", "StateButtonTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrDropDown, "UltraToolbar1", "PopupMenuTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrMenu, tbmgrClick, "UltraToolbar1,PopupMenuTool1", "ButtonTool2" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrDropDown, "UltraToolbar1", "PopupMenuTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrMenu, tbmgrClick, "UltraToolbar1,PopupMenuTool1", "StateButtonTool2" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrDropDown, "UltraToolbar1", "PopupMenuTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrMenu, tbmgrClick, "UltraToolbar1,PopupMenuTool1", "StateButtonTool2" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrDropDown, "UltraToolbar1", "PopupMenuTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrMenu, tbmgrClick, "UltraToolbar1,PopupMenuTool1", "StateButtonTool2" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrClick, "UltraToolbar1", "StateButtonTool1" SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top").PerformToolAction tbmgrToolbar, tbmgrClick, "UltraToolbar1", "ButtonTool1" SwfWindow("Form1").Close
Video:
Thank you for your response. It is clear how to press menu item. The thing that I trying to understend is - how could I check if the menu item is sticked or not. For example, on very schematic level like this: if Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 SwfWindow("Form1").SwfObject("_Form1_Toolbars_Dock_Area_Top") .PerformToolAction tbmgrToolbar, tbmgrClick, "UltraToolbar1", "StateButtonTool1".sticked then do smth else so smth end if
If you want to know if the StateButtonTool is checked, maybe you could try :
SwfWindow("Form1").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItemProperty "UltraToolbar1", "StateButtonTool1", "Checked" in your If condition
Let me know if you have any further questions
Regards
Hi, issue is solved, thank you!
Another problem is apeared:
When I use next:
tlb = _
SwfWindow("QTE").SwfToolbar("MenuToolbar").GetContent
I`ve got an error:
IG : The supplied argument [] is not one of the expected type(s) : String or Int16Function file: [QualityCenter] Subject\Temp\SubRoutineFunctions.vbsLine (1967): "tlb = _".
Could you please suggest way to solve?
Thanks!
Hello,
The GetContent method takes a single parameter for the toolbar that you want to get the content of. It will then return a list of the captions for all of the tools in the toolbar. As far as the parameter, an example would be the first parameter that was recorded for a ClickToolbarTool method.
Note that details on the methods for TestAdvantage can be found in the help that was installed with TestAdvantage and is accessible from the start menu.
Let me know if you have any questions with this matter.
Ok, thank you!
Other question:
How could I get the nested object? fot example the btn from menu (please, refer to below)
How can I determine the path to the nested object?
Thanks in advance
dmoskalenko said:How could I get the nested object? fot example the btn from menu (please, refer to below)
Maybe one possible approach could be if you are using :
SwfWindow("Form1").SwfToolbar("_Form1_Toolbars_Dock_Area_Top").GetItem "UltraToolbar1", 2
where 2 in my sample is the index of desired tool.