Automated test not able to run

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

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, Nullable1 remoteConnectionTimeout, Int32 restClientTimeout) FirefoxDriver.ctor(Uri remoteAddress, String token, FirefoxOptions firefoxOptions, String projectName, String jobName, Boolean disableReports, ReportType reportType, String reportName, String reportPath, Nullable1 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();
        }
        
    }
}

Hi, try this out:

using NUnit.Framework;
using OpenQA.Selenium;
using TestProject.OpenSDK.Drivers.Web;

namespace TestProjectOpenSDK_CS
{
    public class Tests
    {
        private IWebDriver _driver;
        private string _token = "<your token>";

        [SetUp]
        public void Setup()
        {
            // tell the driver to use FireFox
            OpenQA.Selenium.Firefox.FirefoxOptions _firefoxOptions = new OpenQA.Selenium.Firefox.FirefoxOptions();

            _driver = new FirefoxDriver(null, _token, firefoxOptions: _firefoxOptions);
            _driver.Navigate().GoToUrl("https://www.google.co.uk");
        }

        [Test]
        public void Test1()
        {
            // accept cookies
            _driver.FindElement(By.Id("L2AGLb")).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();
        }

    }
}

Hi,
thank you, i tried again with debugging and recived this error:

Exception has occurred: CLR/System.TypeLoadException
An exception of type ‘System.TypeLoadException’ occurred in TestProject.OpenSDK.dll but was not handled in user code: ‘Could not load type ‘OpenQA.Selenium.Remote.ICommandExecutor’ from assembly ‘WebDriver, Version=4.0.0.0, Culture=neutral, PublicKeyToken=null’.’
at TestProject.OpenSDK.Drivers.BaseDriver…ctor(Uri remoteAddress, String token, DriverOptions driverOptions, String projectName, String jobName, Boolean disableReports, ReportType reportType, String reportName, String reportPath, Nullable1 remoteConnectionTimeout, Int32 restClientTimeout) at TestProject.OpenSDK.Drivers.Web.FirefoxDriver..ctor(Uri remoteAddress, String token, FirefoxOptions firefoxOptions, String projectName, String jobName, Boolean disableReports, ReportType reportType, String reportName, String reportPath, Nullable1 remoteConnectionTimeout, Int32 restClientTimeout)
at TestProjectOpenSDK_CS.Tests.Setup() in c:.vscode\Auto\TestProject_SDK.cs:line 20

It feels like your TestProject.OpenSDK install is broken or you do not have all the dependencies.
Try re-installing the NuGet package.

Can you please tell me what i need to install through NUget?

In Visual Studio you would go to Project > Manage NuGet Packages…
In VSCode you would do something like “dotnet add package TestProject.OpenSDK --version 1.2.4”
See here: