chris_adair
15 years agoOccasional Contributor
Having trouble with XtraMainMenu Click events in TestComplete 7.5.2
I have JScript scripts that I have written in Test Complete 6. They use the XtraMainMenu property of a window to click the Menu items on the menu bar. I have converted my scripts into Test Complete 7, and anytime I get to a point in the script that it tried to Click in the menu item, the script fails. Sometimes it fails on the first attempt, others the second attempt, if it is in a loop. The code I have is similar to the following:
wMain.XtraMainMenu.Click("File|Close");
In these cases wMain is the windows object that has the XtraMainMenu property. If I reset the wMain just before I call the Click command, then it seems to work, however, this does not make sense since wMain should not have changed since it was first initialized.
wMain = Sys.Process("My Program").WinFormsObject("MyWindow")...etc
wMain.XtraMainMenu.Click("File|Close");
Resetting wMain each time seems to work, but I do not want to have to do this for each time I need to click the menu; as i did not have to do so in Test Compelte 6. Any help would be appreciated.
Thanks!
Chris
wMain.XtraMainMenu.Click("File|Close");
In these cases wMain is the windows object that has the XtraMainMenu property. If I reset the wMain just before I call the Click command, then it seems to work, however, this does not make sense since wMain should not have changed since it was first initialized.
wMain = Sys.Process("My Program").WinFormsObject("MyWindow")...etc
wMain.XtraMainMenu.Click("File|Close");
Resetting wMain each time seems to work, but I do not want to have to do this for each time I need to click the menu; as i did not have to do so in Test Compelte 6. Any help would be appreciated.
Thanks!
Chris