如何从单独的项目调用encodeui测试 [英] How to call codedui test from a seperate project

查看:93
本文介绍了如何从单独的项目调用encodeui测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是VS2010的新手,所以请耐心等待。 我正在测试的第一个应用程序中有5个或6个窗口。 我为第一个窗口创建了一个VS项目(我们称之为project1)。  Project1中有多个编码的ui测试,一个
是一个正面测试,其中正确测试,其他测试是阴性测试和一些额外的阳性测试。 然后我为第二个窗口创建了另一个项目(让我们称之为project2)。  Project2还有多个编码的ui测试,其中
也是。 对于Project2,我想从Project1调用正编码的ui测试,以便在开始测试第二个窗口之前,我在应用程序中处于正确的位置。 如何在没有为每个下游窗口反复重新录制
正面测试的情况下执行此操作?

I'm new to VS2010 so bear with me.  The first piece of the application I am testing has 5 or 6 windows in it.  I created a VS project (let's call it project1) for the first window.  Project1 has multiple coded ui tests in it, one is a positive test where everthing is done properly, the others are negative tests and some additional positive tests.  I then created another project (let's call it project2) for the second window.  Project2 has multiple coded ui tests in it also.  For Project2 I would like to call the positive coded ui test from Project1 so that I am in the correct position in the application before I begin testing the second window.  How can I do this without re-recording the positive test over and over again for each down stream window?

我在Project2中创建了一个测试设置一个指向Project1的正编码ui测试的安装脚本,但是当我尝试使用此安装脚本运行Project2的编码ui测试时,它只是返回并显示Not Executed。

I created a Test Setting in Project2 that had a Setup Script that pointed to Project1's positive coded ui test but when I tried to run Project2's coded ui test with this setup script it just comes back and says Not Executed.

我也看了这个发布
http: //social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/8e9e206f-d5fc-4a42-8e7b-6a8705a4300a
 但是并没有真正看到答案。

I also looked at this posting http://social.msdn.microsoft.com/Forums/en-US/vsautotest/thread/8e9e206f-d5fc-4a42-8e7b-6a8705a4300a but did not really see an answer.

我是否需要在一个项目中完成所有测试? 我真的不想这样做,因为最终可能会有数百次测试。 或者我做错了什么?

Do I need to have all my tests in one project?  Which I don't really want to do because there could end up being hundreds of tests.  Or what am I doing wrong?

提前致谢。

推荐答案

a123Sean123,

a123Sean123,

 

您不必将所有测试都放在一个项目中,但是如果你把它放在一个项目上就不会产生太大的开销。路线 使用一个项目,您可以在单个项目下创建多个测试类。 每个测试类可以包含多个
测试方法,并允许您在共享UIMaps的同时组织项目。 在我看来,这将是理想的方法。 

You don't have to put all of your tests in one project, but it shouldn't create too much overhead if you took that route.  Using one project, you could create multiple test classes under the single project.  Each test class can contain multiple test methods and allow you to organize your project while being able to share UIMaps.  This would be the ideal approach in my opinion. 

 

有关使用多个UI地图的示例,请参阅此帖子,请注意组织利益 示例 项目 提供:

See this post for an example of using multiple UI Maps, note the organizational benefit the sample project provides:

演练:在测试自动化中使用多个编码的UI地图

< a href ="http://blogs.msdn.com/b/anutthara/archive/2010/02/10/walkthrough-using-multiple-coded-ui-maps-in-test-automation.aspx\"rel ="nofollow "> http://blogs.msdn.com/b/anutthara/archive/2010/02/10/walkthrough-using-multiple-coded-ui-maps-in-test-automation.aspx

 

要创建单独的测试类,只需在同一个项目中创建一个新的测试类,然后开始定义测试方法。 这样你的heirarchy应该是这样的:

To create a seperate test class, just create a new test class within the same project and begin defining your test methods.  In this way your heirarchy should look like:

 

测试项目

--- ----------> UIMaps

------------->UIMaps

----------------------> Map1

----------------------> Map1

----------------------> Map2

----------------------> Map2

-------------> Test Class 1

------------->Test Class 1

--------- ------------------->测试方法1a

---------------------------->Test Method 1a

--------------- ------------->测试方法2b

---------------------------->Test Method 2b

------------->测试类2

------------->Test Class 2

---------------------------->测试方法2a

---------------------------->Test Method 2a

---------------------------->测试方法2b

---------------------------->Test Method 2b

 

 

如果您确实需要使用在单独项目中创建的测试,请在引用中添加项目引用,该引用指向包含该项目的项目您希望参考测试。

If you really need to use a test created in a seperate project, add a project reference in your references which points to the project containing the test you wish to reference.

 

如果此信息与您的问题相关,请将此信息标记为非常有效,如果您已将其标记为已解答感觉你的问题已经满足。

Please mark this post as hepful if this information is relevant to your issue and mark as answered if you feel your question has been satisfied.

 

干杯,

Paul

 


这篇关于如何从单独的项目调用encodeui测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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