TestComplete Menu Item - menu

I am new to TestComplete. I have a question and it may be something impossible or too simple. I have a toolbar containg File, Edit, View, etc. I want to get one item (eg. Edit) to mapped objects. I can get the whole toolbar only. I want to simulate a click event on Edit. How can I do this?

As a rule, TestComplete does not work with menu items as with separate objects. It works with a menu object or even only with a menu's parent object and you can specify which item to select by passing the caption of this item to the corresponding method of a menu object. For example:
objMenu.Click("Edit|Paste");
// or
parent.MainMenu("Edit|Paste");
Please find more details on how TestComplete interacts with menus in the Working With Menus help topic.

Related

Chrome Extension Context Menu Items Limit

Although the docs are pointing out:
The maximum number of items that can be added to the top-level browser action context menu is menus.ACTION_MENU_TOP_LEVEL_LIMIT, but you can add any number of items to submenus.
I am only able to add 1000 submenu items to the Chrome Extension context menu.
I don't want to create a UI additionally, because the context menu is really handy for my use case. The user is working in a code editor and can look up code syntax string values via the context menu and can add the value at the position of the cursor where the user right-clicked.
Do you know of such limitations or a workaround besides using an additional UI element?

Can the context menu be changed dynamically?

Is it possible to change the context menu dynamically, once the tabulator table is already built?
I need to change the context menu according to the cell value under the mouse cursor, so if I could somehow change the context menu inside the cellMouseOver callback, that would be great.
Thanks,
Matic
Instead of specifying a menu object, what you want is a Menu Items Generator Function. The example on that page shows returning one menu if approved is false and a different menu if approved is true.

Extending the "Files" menu

I have a process that involves extending the "Files" menu that is located on (most) acumatica pages (next to notes and activities in the top right)
I would like to add two columns to the table that appears in the smartpanel.
I have been looking for the source code/data behind this smart panel and I cant seem to find it, is it tied into SM202520 (search in files)? Can it be extended?
Am I better off just adding a PXAction button to the 3 or 4 pages I want my extended "files" menu to be?
Thanks
There's no DataView bound to that dialog, you can verify that by using inspect element shortcut key CTL+ALT+CLICK on a grid column header:
In order to be customized the grid needs to be bound to a DataView which inspect element reveals it is not. The lack of DataView binding is by design and therefore that dialog can't be customized.
A grid that can be customized will show the View Name property:

Element not recognized

Working on Coded UI testing and for scripts developed using Record Capture and playback feature (ctrl +I).
The problem is when the page has sub-menus (e.g. I need to hover over menu link then click sub-menu). When I record and capture element using Ctrl+I and executed a script it recognizes, but when I ran the script for the second time the element gets changed and it's not recognized.
I have tried simple x path utility posted here but coudn't able to use this feature. What would be the problem for always element id's getting changed. How to resolve it ?
Are you sure it isn't a nested object?
See http://executeautomation.com/blog/how-to-identify-all-the-child-elements-within-a-page-in-coded-ui-test-cuit/
You could also try EnsureClickable()
There could few reasons behind not recognizing an element:
List item Element is not visible when you are trying to click on it.
If Type of Parent Element is e.g. winclient then it’s difficult in coded UI to identify its child elements.
There could various solutions, you can try:
First Click on Menu Item and then click on Sub Menu Item, if you are directly clicking on sub menu item in your recorded script, this will make sub menu element visible.
Also you can check the visibility from Coded UI Test Builder-> Add Assertion button then going to UI Control Map, then select the element in tree and click on Refresh. It will show if element is visible or not.
If Ids are changing, then you can various other properties like Name, ClassName, InnerText, ControlType, TagInstance, ControlName etc. whichever is supported by Element.

Extension-Specific Context Menu

I'm trying to add an item to the right-click menu on my extension. I've tried to find a method which would work, but a lot of the results seem to deal with context menus on the actual page, not the extension icon itself. The contextMenus API doesn't seem to work for this, unfortunately.
There is currently no API for that. Head for Chromium Issue 78631 and click the star to cast your vote for it and receive updates by e-mail. In the meantime, you could create a popup with a menu that lists both the primary action and the actions you would have put in the context menu.
(I assume you're trying to add the context menu item to your browser action. Your question is a little ambiguous.)

Resources