Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An exception is thrown when trying to navigate to a URL using the latest version of Windows 10 and the Microsoft Edge browser #185

Open
icnocop opened this issue Apr 21, 2019 · 0 comments · May be fixed by #204

Comments

@icnocop
Copy link
Contributor

icnocop commented Apr 21, 2019

Hi.

SpecBind 2.1.1.413
Windows 10 Version 1809 (Build 17763.437)
Microsoft Edge 44.17763.1.0
Selenium 3.5.1

Scenario: Navigate to the logon page
    Given I navigated to the Logon page
    Then I am on the Logon page

Using MicrosoftWebDriver v6.17134, an exception occurs:

OpenQA.Selenium.WebDriverException: Unexpected error. Unknown error.
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService service, EdgeOptions options)
   at SpecBind.Selenium.Drivers.SeleniumEdgeDriver.CreateLocalDriver(BrowserFactoryConfiguration browserFactoryConfiguration) in C:\github\dpiessens\specbind\src\SpecBind.Selenium\Drivers\SeleniumEdgeDriver.cs:line 28
   at SpecBind.Selenium.Drivers.SeleniumDriverBase.Validate(BrowserFactoryConfiguration browserFactoryConfiguration, String seleniumDriverPath) in C:\github\dpiessens\specbind\src\SpecBind.Selenium\Drivers\SeleniumDriverBase.cs:line 92
   at SpecBind.Selenium.SeleniumBrowserFactory.ValidateDriverSetup(ILogger logger) in C:\github\dpiessens\specbind\src\SpecBind.Selenium\SeleniumBrowserFactory.cs:line 132
   at SpecBind.BrowserSupport.BrowserFactory.ValidateDriverSetup() in C:\github\dpiessens\specbind\src\SpecBind\BrowserSupport\BrowserFactory.cs:line 102
   at SpecBind.BrowserSupport.WebDriverSupport.CheckForDriver() in C:\github\dpiessens\specbind\src\SpecBind\BrowserSupport\WebDriverSupport.cs:line 71
   at SpecBind.BrowserSupport.WebDriverSupport.BeforeTestRun() in C:\github\dpiessens\specbind\src\SpecBind\BrowserSupport\WebDriverSupport.cs:line 51
   at lambda_method(Closure , IContextManager )
   at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, HookType hookType)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType hookType)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnTestRunStart()
   at TechTalk.SpecFlow.TestRunner.OnTestRunStart()
   at TechTalk.SpecFlow.TestRunnerManager.InitializeBindingRegistry(ITestRunner testRunner)
   at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(Int32 threadId)
   at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Int32 threadId)
   at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Assembly testAssembly, Nullable`1 managedThreadId)
   at SpecBind.Selenium.IntegrationTests.Features.EdgeBrowserFeature.FeatureSetup(TestContext testContext)

Using MicrosoftWebDriver v10.0.17763.1, an exception occurs:

System.InvalidOperationException: System.InvalidOperationException: The specified arguments passed to the command are invalid.
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Edge.EdgeDriver..ctor(EdgeDriverService service, EdgeOptions options)
   at SpecBind.Selenium.Drivers.SeleniumEdgeDriver.CreateLocalDriver(BrowserFactoryConfiguration browserFactoryConfiguration) in C:\github\dpiessens\specbind\src\SpecBind.Selenium\Drivers\SeleniumEdgeDriver.cs:line 28
   at SpecBind.Selenium.Drivers.SeleniumDriverBase.Validate(BrowserFactoryConfiguration browserFactoryConfiguration, String seleniumDriverPath) in C:\github\dpiessens\specbind\src\SpecBind.Selenium\Drivers\SeleniumDriverBase.cs:line 92
   at SpecBind.Selenium.SeleniumBrowserFactory.ValidateDriverSetup(ILogger logger) in C:\github\dpiessens\specbind\src\SpecBind.Selenium\SeleniumBrowserFactory.cs:line 132
   at SpecBind.BrowserSupport.BrowserFactory.ValidateDriverSetup() in C:\github\dpiessens\specbind\src\SpecBind\BrowserSupport\BrowserFactory.cs:line 102
   at SpecBind.BrowserSupport.WebDriverSupport.CheckForDriver() in C:\github\dpiessens\specbind\src\SpecBind\BrowserSupport\WebDriverSupport.cs:line 71
   at SpecBind.BrowserSupport.WebDriverSupport.BeforeTestRun() in C:\github\dpiessens\specbind\src\SpecBind\BrowserSupport\WebDriverSupport.cs:line 51
   at lambda_method(Closure , IContextManager )
   at TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, HookType hookType)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.FireEvents(HookType hookType)
   at TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnTestRunStart()
   at TechTalk.SpecFlow.TestRunner.OnTestRunStart()
   at TechTalk.SpecFlow.TestRunnerManager.InitializeBindingRegistry(ITestRunner testRunner)
   at TechTalk.SpecFlow.TestRunnerManager.CreateTestRunner(Int32 threadId)
   at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Int32 threadId)
   at TechTalk.SpecFlow.TestRunnerManager.GetTestRunner(Assembly testAssembly, Nullable`1 managedThreadId)
   at SpecBind.Selenium.IntegrationTests.Features.EdgeBrowserFeature.FeatureSetup(TestContext testContext)

In order to resolve the issue, I had to:

  1. Update to Selenium.WebDriver.3.141.0 and Selenium.Support.3.141.0.
  2. Remove PhantomJS support
  3. Implement IWebElement.GetProperty in .\src\SpecBind.Selenium\WebElement.cs:
        /// <summary>
        /// Gets the value of a JavaScript property of this element.
        /// </summary>
        /// <param name="propertyName">The name JavaScript the JavaScript property to get the value of.</param>
        /// <returns>The JavaScript property's current value. Returns a <see langword="null" /> if the
        /// value is not set or the property does not exist.</returns>
        public string GetProperty(string propertyName)
        {
            return this.WrappedElement.GetProperty(propertyName);
        }
  1. Rename EdgePageLoadStrategy to PageLoadStrategy to fix a compiler error in .\src\SpecBind.Selenium\Drivers\SeleniumEdgeDriver.cs:
var edgeOptions = new EdgeOptions { PageLoadStrategy = PageLoadStrategy.Normal };
@icnocop icnocop linked a pull request Feb 21, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant