kpb6756 kpb6756 - 1 year ago 120
C# Question

Selenium C# compilation errors with 3.0.0

I am in the process of attempting to upgrade the version of Selenium WebDriver. I was previously using Firefox 31.6 ESR and Selenium 2.42, however I am now using Firefox 45.4 ESR and Selenium 3.0.0 (which I believe should be compatible as this is the latest Firefox ESR).

The C# test projects were referencing a Nuget package with the older version of Selenium, so I changed the package config files to pull the latest, and I now have the nuget package for Selenium 3.0.0 added to my packages directory (downloaded from the Selenium website). However now when I build I am getting errors with the using statements for Selenium

using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Remote;

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

Under the project references I can see that the WebDriver nuget package is listed for Selenium 3.0. I'm new to the C# packages world so would appreciate any advice or things to try to attempt to fix this. Thanks

Answer Source

You might want to check the path to the Selenium .dll in your project, as just upgrading the version in the packages.config doesn't always update the path to the dll in the .csproj.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download