Jump to content
Sign in to follow this  
Ajays

Activate a window whose some part of title varies

Recommended Posts

Ajays

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

Share this post


Link to post
Share on other sites
M a k a v e l !

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]

Share this post


Link to post
Share on other sites
Manjish

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

Share this post


Link to post
Share on other sites
shaj12

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

Share this post


Link to post
Share on other sites
shaj12

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

Share this post


Link to post
Share on other sites
Manjish

u r welcome


[font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com

Share this post


Link to post
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
Sign in to follow this  

×