ilija_panov
14 years agoContributor
Script for ClickButton method regardless of the button parent object ?
Hi to All,
I'm pretty new in using TC, but here is my question. I have a usual desktop Visual C++ 10.0 application with MFC classes featuring the main window with a main menu, and a structure of interlinked nested windows being opened by the main menus and from link buttons on the windows themselfs (there is no limit in number of windows opened at the same time).
All of these windows also provide a button control called BtnClose for closing that window. What I need is a script which will call the ClickButton event on all visible Close buttons regardless of their parrent object. In other words if more windows are opened at the same moment it should call the ClickButton method for all Close buttons belonging to different window objects visible on the screen.
I tried to create this through a KeyWord test pressing a Close button on a randow window and then trying to mask the mapping in order to work with every other window (by removing mapping criteria from the parent and making the mapping for the Close button to apply for every button on the screen).
This method does not work because the btnClose object must be always related to it's parent in the name mapping. I'm looking forward to your suggestions, the other option would be to click the close button at the end of the test for involving every window but using a single script for closing windows regardless of their id would be much better. Thanks in advance.
Best Regards,
Ilija
I'm pretty new in using TC, but here is my question. I have a usual desktop Visual C++ 10.0 application with MFC classes featuring the main window with a main menu, and a structure of interlinked nested windows being opened by the main menus and from link buttons on the windows themselfs (there is no limit in number of windows opened at the same time).
All of these windows also provide a button control called BtnClose for closing that window. What I need is a script which will call the ClickButton event on all visible Close buttons regardless of their parrent object. In other words if more windows are opened at the same moment it should call the ClickButton method for all Close buttons belonging to different window objects visible on the screen.
I tried to create this through a KeyWord test pressing a Close button on a randow window and then trying to mask the mapping in order to work with every other window (by removing mapping criteria from the parent and making the mapping for the Close button to apply for every button on the screen).
This method does not work because the btnClose object must be always related to it's parent in the name mapping. I'm looking forward to your suggestions, the other option would be to click the close button at the end of the test for involving every window but using a single script for closing windows regardless of their id would be much better. Thanks in advance.
Best Regards,
Ilija