开发者

Why is selenium producing this error?

开发者 https://www.devze.com 2023-03-21 18:37 出处:网络
I\'m using selenium 2.0.3 (from a nuget package) for some browser tests. Which all work fine on my lo开发者_StackOverflowcal maching.

I'm using selenium 2.0.3 (from a nuget package) for some browser tests. Which all work fine on my lo开发者_StackOverflowcal maching.

On our TFS build machine I'm getting the following error when a selenium test is run.

System.IO.FileLoadException : Could not load file or assembly 'Newtonsoft.Json, Version=3.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.

How do I ensure that this assembly is loaded. It isn't referenced in the project but is required by selenium.

UPDATE

I don't know what I've done, but it works now.... it's a mystery. Sorry I can't post the solution, I don't know what it was.


You need to install selenium 2.0.3 and all its dependencies on the build server.

Thanks

M.Radwan


See my answer on managing build-time dependencies here: Dependency management with TFS 2010

You can use the NuGet command line tool to update your dependencies as part of your build process using a simple modification to your *.*proj file.


There is now (as of version 2.2.0) an official NuGet package from the Selenium team, which can be found at this link. It should contain the correct dependencies. Should you decide to use the .zip file distribution at the project site, you'll need references to Newtonsoft.Json.Net35.dll from JSON.NET 4.0r2, and Ionic.Zip.Reduced.dll from DotNetZip 1.9.

0

精彩评论

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

关注公众号