1

I try to make an automation test with TestProject SDK on FireFox Web, when i try to run the test i recived the following message :

  Message: 
System.TypeLoadException : Could not load type 'OpenQA.Selenium.Remote.ICommandExecutor' from assembly 'WebDriver, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null'.
TearDown : System.NullReferenceException : Object reference not set to an instance of an object.

  Stack Trace: 
BaseDriver.ctor(Uri remoteAddress, String token, DriverOptions driverOptions, String projectName, String jobName, Boolean disableReports, ReportType reportType, String reportName, String reportPath, Nullable`1 remoteConnectionTimeout, Int32 restClientTimeout)
FirefoxDriver.ctor(Uri remoteAddress, String token, FirefoxOptions firefoxOptions, String projectName, String jobName, Boolean disableReports, ReportType reportType, String reportName, String reportPath, Nullable`1 remoteConnectionTimeout, Int32 restClientTimeout)
Tests.Setup() line 18
--TearDown
Tests.CleanUp() line 35

this is my code :

using NUnit.Framework;
using OpenQA.Selenium;
using TestProject.OpenSDK.Drivers.Web;
//using OpenQA.Selenium.Firefox;
using WebDriverManager;
using WebDriverManager.DriverConfigs.Impl;

namespace TestProjectOpenSDK_CS
{
    public class Tests
    {
        private IWebDriver _driver;
        private string Token = "Token";
        [SetUp]
        public void Setup()
        {
            //new DriverManager().SetUpDriver(new ChromeConfig());
            _driver = new FirefoxDriver(null, Token);
            _driver.Url = "some web site";
        }

        [Test]
        public void Test1()
        {
            _driver.FindElement(By.LinkText("Login")).Click();

            _driver.FindElement(By.Id("UserName")).SendKeys("...");
            _driver.FindElement(By.Id("Password")).SendKeys("password");
            _driver.FindElement(By.CssSelector(".btn-default")).Click();
        }

        [TearDown]
        public void CleanUp()
        {
            _driver.Quit();
        }
        
    }
}

Thanks in advance!

Greg Burghardt
  • 17,900
  • 9
  • 49
  • 92

0 Answers0