Welcome to the Question and Answer site for Software Testing Professionals

You can get your queries resolved from Software Testing Professionals.

Ask a Question

Get answers and give answers to questions from other members.

View All Questions

Get votes and earn points to build your reputation in community.

View Hot Questions

Getting exception of type 'System.InvalidOperationException' occurred in WebDriver.dll when initializing RemoteWebDriver

Open 1 Answers 105 Views
0 1

I am getting this exception in initializing RemoteWebDriver instance.

Using C# with Selenium

Please see code snippet below.

using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Remote;

namespace FF
internal class Test
private static void Main(string[] args)
IWebDriver driver;
Uri _internalSeleniumGrid = new Uri("http://x.x.x.x:4444/wd/hub");

        FirefoxProfile profile = new FirefoxProfile();
        FirefoxOptions options = new FirefoxOptions
            UseLegacyImplementation = true
        DesiredCapabilities capabilities = (DesiredCapabilities)options.ToCapabilities();
        capabilities.SetCapability(FirefoxDriver.ProfileCapabilityName, profile.ToBase64String());

        driver = new RemoteWebDriver(_internalSeleniumGrid, capabilities);



'System.InvalidOperationException' occurred in WebDriver.dll when initializing RemoteWebDriver

1 Answer

DesiredCapabilities capabilities = (DesiredCapabilities)options.ToCapabilities();

You can simply use

ICapabilities capabilities = options.ToCapabilities();

Rest of stuff looks good.



You will need protocol in the URL.

answered by (192 points)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

We have resolved 1.2k+ Software Testing queries!

Software Testing Board Weekly update

We will send you handpicked questions that you would love to answer.

View previous campaigns.

Top Contributors