2

When i create build after creating a build definition for a test project developed using selenium references it throws me an error as follows.

"The type or namespace name 'OpenQA' could not be found (are you missing a using directive or an assembly reference?)"

Even though i have used appropriate references in my project and it does not throw any error while running the test.

Error remains the same on adding reference as.

Using OpenQA;

What i am planning to do is to create a test a project using selenium references and execute it using Test Manager.

Please Help!!!

Thanks in advance.

Varun Bajpai
  • 545
  • 5
  • 20
  • 1
    Do you have a reference to the Selenium libraries? – Arran Sep 30 '13 at 14:18
  • My best guess is `no` @Arran. `:)` – ddavison Sep 30 '13 at 14:27
  • problem is, with all of us, in these In dont understand problems, things seems to work just fine locally. BUT then you migrate to the build server, all sort of hell breaks loose. I've been working on Making selenium work with TFS - I'm four weeks into this problem. Still no cigar. Using MsTest v2 make it even worse. – Christian Jul 02 '20 at 07:43

2 Answers2

1

As @Arran stated.. The evidence suggests that you really do not have the appropriate assembly references.

Excerpt from the WebDriver Documentation -

As of Selenium 2.2.0, the C# bindings are distributed as a set of signed dlls along with other dependency dlls. Prior to 2.2.0, all Selenium dll’s were unsigned. To include Selenium in your project, simply download the latest selenium-dotnet zip file from https://code.google.com/p/selenium/downloads/list. If you are using Windows Vista or above, you should unblock the zip file before unzipping it: Right click on the zip file, click “Properties”, click “Unblock” and click “OK”.

Unzip the contents of the zip file, and add a reference to each of the unzipped dlls to your project in Visual Studio (or your IDE of choice).

Community
  • 1
  • 1
ddavison
  • 28,221
  • 15
  • 85
  • 110
  • I have used following dlls Selenium.WebDriverBackedSelenium.dll ThoughtWorks.Selenium.Core.dll WebDriver.dll WebDriver.Support.dll and i am not able to figure out the issue because test runs fine when executed standalone but build creation is failing using build definition. – Varun Bajpai Sep 30 '13 at 15:43
  • @VarunBajpai, make sure Copy Local is set to true in the properties window of each individual reference. – Arran Sep 30 '13 at 15:55
  • Using using WebDriver.OpenQA.Selenium.Firefox; using WebDriver.OpenQA.Selenium; also provides no help..!!! compilation fails.... – Varun Bajpai Sep 30 '13 at 16:05
  • @Arran, Copy Local is set to true for all the references. – Varun Bajpai Sep 30 '13 at 16:07
1

Problem resolved.

While creating a build definition, under 'Process', in 'items to build' we need to set proper 'configurations'. Using 'Configurations' as 'release' and platform as 'x86' or according to your CPU will resolve the problem.

Varun Bajpai
  • 545
  • 5
  • 20