Selenium: System.IO.FileNotFoundException : Could not load file or assembly 'netstandard2.0assembly with Selenium 4.0.0-alpha04 and .NET Core

Created on 12 Jan 2020  路  7Comments  路  Source: SeleniumHQ/selenium

馃悰 Bug Report

I using .NET Core with C# and I got this error when upgraded to Selenium 4.0.0-alpha04

System.IO.FileNotFoundException : Could not load file or assembly 'netstandard2.0assembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.
and the browser didn't open it failed from the beginning.

To Reproduce

Detailed steps to reproduce the behavior:

Expected behavior

The browser should be opened and run the script

Test script or set of commands reproducing this issue

using NUnit.Framework;
using OpenQA.Selenium;
using OpenQA.Selenium.Chrome;

namespace Selenium4
{
    public class RelativeLocators
    {
        private IWebDriver _driver;

        [SetUp]
        public void Setup()
        {
            _driver = new ChromeDriver();
            _driver.Navigate().GoToUrl("https://the-internet.herokuapp.com/");
            _driver.Manage().Window.Maximize();
        }

        [Test]
        public void ClickLoginLink()
        {
            _driver.FindElement((RelativeBy.
                WithTagName("li")
                .Below(By.LinkText("Forgot Password"))
                .Above(By.LinkText("Frames")))).Click();
            Assert.IsTrue(_driver.Url.Contains("login"));
        }
    }
}

Screenshot

Screenshot 2020-01-12 at 15 24 50

Environment

OS: OSX 10.14.6
Browser: Chrome
Browser version: 79
Browser Driver version: ChromeDriver 2.37
Language Bindings version: C#

needs-triaging

Most helpful comment

Encountered this, downgraded to 4.0.0-alpha03 and it got me past this.

All 7 comments

Encountered this, downgraded to 4.0.0-alpha03 and it got me past this.

this solution works well

@BasHamer I know that I was trying the relative locators with alpha04 which is not in alpha03

Not sure, I can check if desired. I don't think we use relative locators after we found bugs in version selenium version 3. (It did not handle xpath OR properly )

I also have this issue with alpha04, unable to run any tests with our framework and have had to revert to alpha03 in the meantime.
We are not using any of the new selenium 4.0.0 functions and it was purely the move to alpha04 which cause this issue to manifest.

There was a bug introduced in the build process for the .NET bindings in alpha 4. It鈥檚 been fixed in 52b6789. The next release should not have this issue. As usual, I can offer no specific times for a next release.

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings