Contributions
CLR Bridge and .NET Method Overloads - Ordering
Interfacing between .NET assemblies and the TestComplete script environment is known to be challenging since the latter does not support method overloading. Rather, it appends a suffix (e.g. Method(), Method_2(...)) to the method name. We recently came upon an issue where a developer added a new signature to a particular method, and when the TestComplete script ran it selected the new, incompatible one instead of the correct, older one. My question is: Is there any way to know in advance how TestComplete will number the method overloads? How does TestComplete determine which signature is the "original" and which is the "overload" - with a numbered suffix?1.3KViews0likes0CommentsAlias a Mapped Object Under a Different Parent Object
Question Using TC 10, I notice that I am unable to drag and drop an Alias to any position within the Alias tree. Instead, I can only place aliases as a child of other Aliases which are in the objects inheiretance tree. During drag-and-drop, a white circle with a slash through it indicates that I am not allowed to put the alias at any arbitrary location. Why is this so? If I edit the tcMN XML file directly, I can place aliases anywhere I want. Doesn't this defeat the purpose of Aliasing? Example Before you ask "why would you want to do that," here is a simple example of why this feature is needed: In Java, menu bars, menus, and menu items (java.awt.Component) are not represented in the object model the way one would expect. The MenuBar class contains top-level menus (e.g. "File", "View", "Help"), and when each of these items is clicked, it displays a list of MenuItem's. However, these MenuItem's are rendered under a shared PopupMenu object. Every single click of a menu from the MenuBar uses the same PopupMenu object, and this object is a sibling, not a child of the MenuBar. This means, if I want to navigate the menu File > Print, I have to: Aliases.MainWindow.MenuBar.File.Click(); Aliases.MainWindow.PopupMenu.FilePrint.Click(); The MainWindow.PopupMenu would then contain every single MenuItem used in the application. This list can be very long, and is somewhat counter intuitive. By hacking the XML file, I am able to get the desired result: Aliases.MainWindow.MenuBar.File.Click(); Aliases.MainWIndow.MenuBar.File.Print.Click();2.6KViews0likes0CommentsRe: How to stop Current Test Item execution and proceed to the next Test Item.
The OnStopTest event is fired for several different reasons (e.g. Runner.Halt, exception, or the test completed successfully). How is it possible to know why the event was raised? At the point you reach the OnStopTest handler, all the script variables have been disposed.1.2KViews0likes0Comments