Jump to content

Activate a window whose some part of title varies


Ajays
 Share

Recommended Posts

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

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 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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...