Jump to content
Sign in to follow this  
Bravolee

How to check if a specific popup shows up?

Recommended Posts

Bravolee

Hi Gens,

I am a newbie. After tutorial, I feel I like this test tools pretty much.

I am working on some pieces for my current project. But after startup the desktop application, if it has been opened, then the application would popup a "software is running" messagebox. I want to write the script to contain this situation.

What should I do ?

Thanks.

Share this post


Link to post
Share on other sites
Earthshine

don't open the app more than once if it's running. 


My resources are limited. You must ask the right questions

 

Share this post


Link to post
Share on other sites
JLogan3o13

@Bravolee there are a couple of ways to handle it. You get look in the help file under Window Management and use a combination of WinWait and WinExists to catch the pop up and deal with it (both sections have very nice example scripts to show you how they work).

A better approach, however, would be to use ProcessExists in your script. If the process for your 3rd party desktop application is already present you can then add some logic on how to handle it (throw an error, simply not open another instance, write to log file, etc.). ProcessExists also has a good example script to show you how it works.

If, after looking at these and trying them out for yourself, you get stuck, feel free to post your code here and we will do our best to assist.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
Bravolee

@JLogan3o13 Thanks so so much. You definitely answered my question. Now I increasing love this testing framework. :-)

Only one more stuff, based on my use these days, looks like AutoIT does not support WPF very well, is it? Or maybe I haven't learned how to make it.

I tried to use the finder tool to get the exact control id or something like that, what I can only get is the Window info. I want to know if AutoIT could be used to do auto test on WPF applications.

Share this post


Link to post
Share on other sites
JLogan3o13

You are correct that some windows will not show all of the control IDs with the native finder. It is at this point that you will want to invest some time reading in this topic:

The SimpleSpy tool has more functionality that the native AutoIt Window Info Tool


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
halo

You can use ProcessExists in your script

Share this post


Link to post
Share on other sites
JLogan3o13

Which is precisely what was suggested to the OP above, @halo


√-1 2^3 ∑ π, and it was delicious!

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  

×