Ask a Question

How do I work with Devexpress PopupMenuBarControl & SubMenuBarControl

PrecisionDan
Occasional Contributor

How do I work with Devexpress PopupMenuBarControl & SubMenuBarControl

Hello,

 

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).

Right clicking a DevExpress treeListRight clicking a DevExpress treeList

 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.

3 REPLIES 3
Kitt
Regular Contributor

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.

[[ kITt: keep IT testing ]]
PrecisionDan
Occasional Contributor

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

PrecisionDan_0-1674796404372.png

 

I've added all of the relevant controls to the DevExpress/Winforms/BarControl Object mapping in the suite settings

PrecisionDan_1-1674796466949.png

 

I've also since added these objects to the MSAA accepted windows too

PrecisionDan_2-1674796515651.png

 

I'll attach some images of the PopupMenuBarControl Properties and Fields below.

 

Properties:

PrecisionDan_3-1674796596531.png

PrecisionDan_4-1674796612125.png

Fields: 

PrecisionDan_5-1674796621174.png

 

PrecisionDan_7-1674796634914.png

 

PrecisionDan_6-1674796628925.png

Methods:

PrecisionDan_8-1674796644663.png

 

 

Any further help is appreciated but I understand it might be difficult since you don't have experience with DevExpress

 

Kitt
Regular Contributor

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"]

to 

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):

Kitt_0-1675175266860.png

which should show the DOM or object "tree" within your tested app, something like:

Kitt_1-1675175459642.png

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:

Kitt_2-1675176660751.png

 

[[ kITt: keep IT testing ]]
cancel
Showing results for 
Search instead for 
Did you mean: