Ajays Posted February 11, 2009 Share Posted February 11, 2009 Hi, I am carrying out gui testing with autoit script on a software. At the end of the test run the script has to close a window whose title is "Save Changes: 7" The number in the window varies like 2 or 4 or 5. So sometimes it can "Save Changes: 4" or sometimes "Save Changes: 5" So how to activate this window with winwait and winactivate commands. How should i activate this window. And i also want to know how to send space bar key in send command. Please let me know. Regards, Ajay Link to comment Share on other sites More sharing options...
M a k a v e l ! Posted February 11, 2009 Share Posted February 11, 2009 (edited) Hi, I am carrying out gui testing with autoit script on a software. At the end of the test run the script has to close a window whose title is "Save Changes: 7" The number in the window varies like 2 or 4 or 5. So sometimes it can "Save Changes: 4" or sometimes "Save Changes: 5" So how to activate this window with winwait and winactivate commands. How should i activate this window. For example on Excel : WinWait("Microsoft Excel - ","") If Not WinActive("Microsoft Excel - ","") Then WinActivate("Microsoft Excel - ","") WinWaitActive("Microsoft Excel - ","") So you don't have to call your filename .xls You should try: WinWait("Save Changes: ","") If Not WinActive("Save Changes: ","") Then WinActivate("Save Changes: ","") WinWaitActive("Save Changes: ","") Sleep(250) Use 'ScriptWriter' from the SciTe folder And i also want to know how to send space bar key in send command. Try help file, search in the Index tab 'Send', WinWaitActive, etc... you have everything there Send("{SPACE}") enjoy ! Edited February 11, 2009 by M a k a v e l ! [font="Lucida Sans Unicode"]M a k. a v e L ![/font] Link to comment Share on other sites More sharing options...
Manjish Posted February 11, 2009 Share Posted February 11, 2009 use autoitsetoption command, and set the wintitlematchmode to match only part of the window title.. AutoItSetOption(WinTitleMatchMode,2) [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
shaj12 Posted February 12, 2009 Share Posted February 12, 2009 For example on Excel : WinWait("Microsoft Excel - ","") If Not WinActive("Microsoft Excel - ","") Then WinActivate("Microsoft Excel - ","") WinWaitActive("Microsoft Excel - ","") So you don't have to call your filename .xls You should try: WinWait("Save Changes: ","") If Not WinActive("Save Changes: ","") Then WinActivate("Save Changes: ","") WinWaitActive("Save Changes: ","") Sleep(250) Use 'ScriptWriter' from the SciTe folder Try help file, search in the Index tab 'Send', WinWaitActive, etc... you have everything there Send("{SPACE}") enjoy ! Thank you M a k a v e l ! Thank you for your help. I would like every one at this forum for solving my problems. Regards, Ajay Link to comment Share on other sites More sharing options...
shaj12 Posted February 12, 2009 Share Posted February 12, 2009 use autoitsetoption command, and set the wintitlematchmode to match only part of the window title.. AutoItSetOption(WinTitleMatchMode,2) Thank you Manjish Your code is working. Thank you Ajay Link to comment Share on other sites More sharing options...
Manjish Posted February 12, 2009 Share Posted February 12, 2009 u r welcome [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now