开发者

Approach to testing GUI using MS TEST / Coded UI in VS2010

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.


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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜