1

I am just jumping into testing of a GUI-heavy app written in C++(MFC) and C# (WinForms, WPF). I have played with coded ui tests briefly, and I am happy with what I see. The trouble is that my program is non-trivial, so this does not work for me for 2 reasons:

VS 2010 Coded UI Test - Launch Referenced Application

  • There are 3 programs to launch in certain order, and I need to log in to one of them. Timing is important; I need to make sure that they have come up.
  • Start-up time is long, so I want to make sure that this set up is only done once per project.
  • When the project is done, I want to cleanly destroy this thing.
  • For each test I would want to make sure that the windows is active and is in the forefront at the beginning of each test.

What are some good approaches? If you find that this question is too vague, please let me know what it is missing.

2 Answers 2

1

There is code that gets generated for the coded UI tests. You can edit the coded UI test and add your own code to wait for things to occur before letting the next recorded step to take place. If you want to bring a certain application to the forefront, you can use Process.GetProcessesByName to get process information about your running application(s) and get its mainwindow handle to bring it to the front.

Sign up to request clarification or add additional context in comments.

Comments

1

I you want to delay your test and wait some tasks (for example log-in or server response) you can check this article. http://msdn.microsoft.com/en-us/library/gg316453.aspx

1 Comment

Thanks, this is a simple technique and might not be powerful enough. I would like to know how I can wait for a particular window with a particular title to come up, and then perhaps wait for another one.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.