Hi,
I have a toolbar with submenus. One of the scenario needs to check the status of one toolbar menu.
If the status is disabled, it should select another toolbar menu. How can I check the status of the toolbar?
Can someone help me?
Thanks in advance
Tinu
Ravi,
Do you have TestAdvantage installed and have you verified that the configuration is correct by recording and replaying scripts on the samples included with TestAdvantage?
If so, then verify with the developers who wrote the application that you are passing in the correct key to the GetItem and GetItemsCount methods.
Let me know if you have any questions with this matter.
Hey Michael,
I need to check whether there are multiple items in the toolbar, how could i achieve it?
The toolbar is recognizing as SwfObject and i'm unable to use GetItem, GetItemsCount properties as they throw an error saying "key not found".
How will i find the key to these toolbar items?
Regards,
Ravi Salunkhe
The solution I am providing unfortunately at the time is limited to simple menus, but with any luck that is the type you are using. This will not work on any of the Ribbon based menus, Navigation Toolbar, or MiniToolbar. We are looking to implement a similar style for other tools soon.
That being said, you should be able to use the GetItemProperty method such as:
Set oTBDockArea = SwfWindow("Form1").SwfToolbar("_Form1_Toolbars_Dock_Area_Top")msgbox oTBDockArea.GetItemProperty("RootMenu", "SubMenu","Enabled")
The first and second parameters are parameters similar to if you were to record your action on the Menu.
If you are using a different style of toolbar you will likely need to get the tools property directly, and that typically would require knowing how your developer setup toolbars.
Hope this helps,