I'm getting the following error when trying to run my selenium webdriver tests from a user control I have created: An exception of type 'System.TypeLoadException' occurred in UserCreationFrontEnd.exe but was not handled in user code
Additional information: Could not load type 'OpenQA.Selenium.Support.UI.WebDriverWait' from assembly 'WebDriver, Version=2.48.2.0, Culture=neutral, PublicKeyToken=null'.
Background story: I have created an app with some automated test suites in that allows people within my team without visual studio to run them. This app is a winforms app and is written in c# and uses user controls. I have added a user control into my selenium solution to run the selenium tests. When I run the user control from here the tests run as expected.
The issue appears when I add the user control into my main application and try and run the selenium tests from there.
The user control is displayed fine, but when I try to start the tests I get the error in my test start up (OneTimeSetUp).
Code:
public void TestStartUp()
{
driver = new InternetExplorerDriver(@"O:\Testing\SDET\SeleniumWebDriver");
wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
config = new MapsPageObjectModel.EnvironmentConfig(driver);
navBar = new MapsPageObjectModel.NavigationBar(driver);
homePage = new MapsPageObjectModel.Homepage(driver);
createContact = new MapsPageObjectModel.CreateContact(driver);
securityManager = new MapsPageObjectModel.SecurityManager(driver);
companyPage = new MapsPageObjectModel.Company(driver);
createEmployee = new MapsPageObjectModel.CreateEmployee(driver);
roles = new MapsPageObjectModel.Roles(driver);
UserCreationResults.Clear();
}
The error happens on this line
wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10));
Does anyone have any idea's?