How do I work with Devexpress PopupMenuBarControl & SubMenuBarControl
I've recently ran into the DevExpress controls of "DevExpress.XtraBars.Forms.SubMenuControlForm", "DevExpress.XtraBars.Controls.PopupMenuBarControl" & "DevExpress.XtraBars.Controls.SubMenuBarControl" in a tested Desktop application I'm testing. I've created a GIF below to show you how these controls are being used \ being generated (via right click).
When I record a Script Test and perform the above action, the below code is generated
var testedApp= Aliases["app"]; var treeListEx = testedApp["ImportLayersWizard"]["WizardControl"]["SelectLayersWizardPage"]["LayersLayoutControl"]["LayersNodeTree"]["Tree"]; treeListEx["ClickCellR"](0, "Column"); var popupMenuBarControl = testedApp["SubMenuControlForm2"]["PopupMenuBarControl"]; popupMenuBarControl["Click"](26, 12); treeListEx["ClickCellR"](0, "Column"); popupMenuBarControl["Click"](69, 16); treeListEx["ClickCellR"](0, "Column"); popupMenuBarControl["Click"](53, 41);
As you can see above, TestComplete recognises the SubMenuControlForm and the PopUpMenuBarControl, but doesn't recognise any of the buttons on it. Does anyone have experience using these controls ? I haven't found anything online that indicates anyone else having issues with them. I'm ideally hoping to use them similar to a XtraPopupMenu from DevExpress, where you can just go "XtraPopUpMenu.Click(MenuItem);
Any help is greatly appreciated here.
I have not used DevExpress so not sure if I'll be any help, but I would suggest reviewing the documentation [here] and [here] to see if you've met all the setup/config requirements. And if you could attach an expanded view of of the PopUpBarMenuControl and its properties from the TC Object Browser, that would be helpful.
Hi @Kitt ,
Thank you for the reply. I've had a look through both of those documentation and it seems I've set it up correctly. I've got the DevExpress script extensions installed
I've added all of the relevant controls to the DevExpress/Winforms/BarControl Object mapping in the suite settings
I've also since added these objects to the MSAA accepted windows too
I'll attach some images of the PopupMenuBarControl Properties and Fields below.
Any further help is appreciated but I understand it might be difficult since you don't have experience with DevExpress
Are you not able to click on the actual checkbox, or is this a part of your test: to right-click and verify the option to "check layers" works? The only thing I notice is that the application prior to right clicking has a different mapped alias (Aliases["app"]), whereas the pop-up control is mapped under Aliases["Spry"]. Try changing the line below from the recorded output:
var popupMenuBarControl = testedApp["SubMenuControlForm2"]["PopupMenuBarControl"]
var popupMenuBarControl = Aliases["Spry"]["SubMenuControlForm2"]["PopupMenuBarControl"]
Apologies on all the screenshot requests, but 2 more that would be more helpful would be from your Object Browser and NameMapping. Use the Object Spy tool to highlight the objects within the pop-up (use the point and click option Shift+Ctrl+A so you can open the pop-up before spying it), once the object name is returned, click on the Highlight in Object Tree (circled below):
which should show the DOM or object "tree" within your tested app, something like:
And since you are using Aliases, it would be helpful to see the object in your Name Mapping editor. You can click on the MappedName from your Object Browser screen and select Show Object in Name Mapping Editor: