Forum Discussion
Once you clicked on the ellipsis, the menu popup appears. The menu item that you are clicking afterwards, have you declared a name mapping for it? If yes, is TestComplete able to identify and highlight the correct menu item? What Keyword action are you performing to click on the menu item?
- ANHristov012 months agoOccasional Contributor
Hi rraghvani
To answer your questions:
1) Yes, after clicking on the ellipsis button ("..."), the menu popup appears correctly.
2) However, there is no specific name mapping created for the individual menu items, because TestComplete does not seem to detect or highlight them properly - it only detects the entire popup container.
3) For the click action, we are using the "Click" keyword (standard keyword test action). The step appears as passed (green), but nothing changes in the UI.When inspecting through the Object Browser, the menu items are not recognized as separate clickable elements - only the general popup or browser window is shown.
Do you think this could be related to how the dropdown is implemented (maybe as a dynamic overlay or shadow DOM element)? And is there a recommended way to make TestComplete identify those inner elements?- rraghvani2 months ago
Champion Level 3
The keyword actions shown in the video, was that from "Record Keyword Test"? If yes, TestComplete may record the wrong actions being performed on the control, i.e. Click(). Try to change the method from Click() to ClickItem("Statements"), and see if that works.
Popup menu items can be tricky to identify with the Object Spy tool, because as soon as the popup menu loses focus, it disappears. Since you are working with a web application, it's possible to change the "visible" property value of the popup menu, so that you can use the Object Spy tool - you will have to use the browsers' DevTools to do this to modify the HTML code.
Here's an example,
Popup is hiddenChanging the visibility property value, to make the popup appear- ANHristov012 months agoOccasional Contributor
Hi rraghvani
Yes, the actions in the video were recorded using "Record Keyword Test". I'll try changing the step from Click() to ClickItem() as you suggested and see if that allows the selection to complete properly.
Regarding the Object Spy issue - yes, that's exactly what happens. The popup disappears immediately after losing focus, so I can't inspect the individual elements. I'll follow your suggestion to modify the "visible" property in DevTools (if I have the permissions for my security team) so that the popup stays open long enough to capture the correct element structure.I'll test both approaches and update the thread once I have results.
- Hassan_Ballan2 months ago
Champion Level 3
To help troubleshoot the issue, you can use the "Point and Fix" feature in TestComplete's Object Spy. This works well for handling elements like disappearing dropdowns.
When using the Object Spy, does a red frame appear around the objects as expected? If so, the Point and Fix option can capture useful details for analysis.
Also, take a look at the TestComplete Run Log. It includes screenshots highlighting the UI object that the action interacted with and where the click occurred. Review this to confirm whether the object and click location match your expectations.
Additionally, you can manually navigate to the desired menu item in the browser, right-click on it, and choose Inspect. This will bring up the corresponding HTML element in the DOM, which can help you understand the parent-child relationship of the element.
From there, you can try crafting an XPath to identify the element. Test it in the browser console to ensure it returns a unique match. If it returns multiple results, check whether the first entry is actually the element you're targeting.
🤖 AI-assisted response
👍 Found it helpful? Click Like
✅ Issue resolved? Click Mark as Solution