Visual Studio 2010 Express C#、NUnit 2.5.8、White 0.2.0
我正在尝试使用 NUnit + White 框架编写一些测试。
我可以毫无问题地启动和运行 White 演示 (ListBoxExample)。
但是当我为自己的应用程序(.Net 4.0)编写一个简单的测试时,我有两个问题:
-
Application.Launch(""):
这个声明没有抱怨,但根本没有启动我的应用程序。路径是正确的,因为如果我输入的路径不正确,则会收到错误消息。如果路径正确,则不会出现错误,但没有应用程序启动。
-
application.GetWindow(...)
此语句会导致错误:
DocBackupTestSuite.Tests.StartupTest:System.IO.FileLoadException:可以
不加载文件或程序集“Bricks”,
版本=1.0.0.0,文化=中立,
PublicKeyToken=null' 或其之一
依赖关系。所在的程序集
清单定义不匹配
装配参考。 (例外情况来自
HRESULT:0x80131040)
但是我的项目中引用了 Bricks.dll 文件...
谢谢您的帮助
Davy
Visual Studio 2010 Express C#, NUnit 2.5.8, White 0.2.0
I am trying to write some tests with the NUnit + White framework.
I can get the White demo (ListBoxExample) up and running without problems.
But when I write a simple test for my own application (.Net 4.0), I have 2 problems:
-
Application.Launch(""):
This statement does not complain, but does NOT launch my application at all. The path is correct because if I put an incorrect path, I get an error. With the right path there are no errors, but no application is starting.
-
application.GetWindow(...)
This statement causes an error:
DocBackupTestSuite.Tests.StartupTest: System.IO.FileLoadException : Could
not load file or assembly 'Bricks,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null' or one of its
dependencies. The located assembly's
manifest definition does not match the
assembly reference. (Exception from
HRESULT: 0x80131040)
But the Bricks.dll file IS referenced in my project...
Thank you for your help
Davy
发布评论
评论(3)
第一个问题解决了。
该代码没有等待足够长的时间来为应用程序启动留出时间。
在Application.Launch()语句后添加了Thread.Sleep(10000),现在它启动了。
第二个问题仍然悬而未决...
有人吗?
First problem is solved.
The code did not wait long enough to leave time for the application to start.
Added a Thread.Sleep(10000) after the Application.Launch() statement, and now it starts up.
2nd problem is still pending...
Anyone?
第二个问题也解决了:
缺少对 Bricks.RuntimeFramework 的引用。
添加此后,我的测试运行良好;)
2nd problem also solved:
A reference to Bricks.RuntimeFramework was missing.
After adding this, my test runs fine ;)
如果您在使用UI自动化库(White-project)时遇到以下问题,
请采取以下解决方案:
添加dll列表的引用如下:
•Bricks
•Bricks.RuntimeFramework
•Castle.Core
•Castle.DynamicProxy2
•log4net
• nunit.framework
•White.NUnit
•Xstream.Core
希望您的代码现在可以成功运行。
在此处下载这些内容
http://white-project.googlecode.com/svn/ tag/0.20/lib/
参考自http://sunshinetoast.com/Default.aspx
If you face this problem below when you use the UI automation library(White-project)
please take the following solution:
Add Reference of the dll list as follow:
•Bricks
•Bricks.RuntimeFramework
•Castle.Core
•Castle.DynamicProxy2
•log4net
•nunit.framework
•White.NUnit
•Xstream.Core
Hope your code can be work successfully now.
Download theses stuff here
http://white-project.googlecode.com/svn/tags/0.20/lib/
Reference fromhttp://sunshinetoast.com/Default.aspx