I have some Selenium test cases which were written in Windows. Now I want to run them in Ubuntu. I found a way to link my C# program and selenium dll using this solution, but I'm getting the following error:
Unhandled Exception: System.IO.FileNotFoundException:
Could not load file or assembly 'WebDriver, Version=3.14.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies.
File name: 'WebDriver, Version=3.14.0.0, Culture=neutral,
PublicKeyToken=null' [ERROR] FATAL UNHANDLED EXCEPTION:
System.IO.FileNotFoundException:
Could not load file or assembly 'WebDriver, Version=3.14.0.0, Culture=neutral, PublicKeyToken=nullure=neutral, PublicKeyToken=null
C#:
using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;
namespace SelTest {
class TestOne {
public static void Main(string[] args) {
IWebDriver driver = new ChromeDriver();
driver.Navigate().GoToUrl("https://www.google.com");
driver.Quit();
}
}
}
Command used for compiling and running:
mcs -r:/home/local/prasanth/test/dist/lib/net45/WebDriver.dll SelTest.cs; ./SelTest.exe
My mono version: 6.6.0.161
The selenium library was downloaded from here.