编码的UI测试和更改窗口标题 [英] Coded UI test and changing window title

查看:70
本文介绍了编码的UI测试和更改窗口标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个WPF应用程序,我正在尝试对其进行编码的ui测试(使用vs 2010 Ultimate).

I have a WPF application that I'm trying to do coded ui tests for (using vs 2010 ultimate). 

现在,我注意到使用记录器时,设置的属性之一是

Now, I have noticed that when I use the recorder, one of the properties that is set is 

this.mUIWhateverTitleBar.WindowTitles.Add(<应用程序名称转到此处> ;:<用户名>"));

this.mUIWhateverTitleBar.WindowTitles.Add("<application name goes here>: <user name>");

(该应用程序的窗口标题格式为<应用程序名称转到此处> ;:<用户名>

(The application has a window title of the format <application name goes here>: <user name>

 

这显然吗?如果除了录制ui测试的用户以外的其他人尝试执行测试,将是一个问题.除了手动执行并更改.designer.cs文件中的所有内容(听起来像一个相当 次优解决方案...)

This obviously? will be a problem if someone else than the user recording the ui test tries to execute the test. Is there something I can do about this other than manually go about and change everything in the .designer.cs file (which sounds like a rather suboptimal solution...)

 

 

推荐答案

WindowTitle不是默认情况下由Codeduitest查找的窗口.它是寻找的TopLevelWindow Name属性.当其他用户使用该测试时,测试是否会失败?如果是,则可以将Name属性更改为< application Name go here> 与PropertyExpressionOperator.包含

WindowTitle is not the one looked up by Codeduitest by default. It is TopLevelWindow Name property which it looks for. Does the test fails when used by some other user? IF yes you can change the Name property to have just <application Name goes here> with PropertyExpressionOperator.Contains

PS:对于codeduitest,请在上发布您的查询 http://social.msdn.microsoft.com/Forums/zh-CN/vsautotest/threads

PS: For codeduitest please post your queries on http://social.msdn.microsoft.com/Forums/en-US/vsautotest/threads

谢谢

悉达多


这篇关于编码的UI测试和更改窗口标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆