-1

I am new in C# and trying to run a simple driver.Naviage().GoToUrl("http://www.google.com"); with selenium and C# but I am keep getting "command line server for the IE driver has stopped working" error. And on my Script I am getting error "OpenQA.selenium.WebDriverExcption: 'cannot start the driver service on http://localhost:55459/'. complete error:

   OpenQA.Selenium.WebDriverException
      HResult=0x80131500
      Message=Cannot start the driver service on http://localhost:55459/
      Source=WebDriver
      StackTrace:
       at OpenQA.Selenium.DriverService.Start()
       at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
       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.IE.InternetExplorerDriver..ctor(InternetExplorerDriverService service, InternetExplorerOptions options)
       at OpenQA.Selenium.IE.InternetExplorerDriver..ctor()
       at SeleniumFirst.Program.Main(String[] args) in F:\clone Repo\SeleniumFirst\SeleniumFirst\SeleniumFirst\Program.cs:line 15

My Test Script:

using OpenQA.Selenium;
using OpenQA.Selenium.IE;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SeleniumFirst

    {
        class Program
        {
            static void Main(string[] args)
            {
                IWebDriver driver = new InternetExplorerDriver();
    
                driver.Navigate().GoToUrl("https://www.google.com");
    
            }
        }
    }

My configure file:

 <?xml version="1.0" encoding="utf-8"?>
    <packages>
      <package id="Selenium.InternetExplorer.WebDriver" version="3.150.1" targetFramework="net461" />
      <package id="Selenium.Support" version="3.141.0" targetFramework="net461" />
      <package id="Selenium.WebDriver" version="3.141.0" targetFramework="net461" />
      <package id="Selenium.WebDriver.IEDriver" version="https://protect-us.mimecast.com/s/AyNYC5yXZ3f0PPoiOlacl?domain=3.150.1.2" targetFramework="net461" />
      <package id="Selenium.WebDriver.IEDriver64" version="3.141.59" targetFramework="net461" />
    </packages>
Tarishah
  • 55
  • 5
  • "Selenium with C#" is not a question. Please change your title to something relevant to the question you are asking. – JeffC Apr 23 '21 at 18:39

1 Answers1

0

This works for me. So I used your configuration, as you specified, in my package.config file and also set the the .net framework to 4.6.1 as yours.

I also used your exact code.

The only difference I believe is that I downloaded the IE Driver Executable from the link below and dropped it in the bin directory:

https://www.selenium.dev/downloads/

if you don't want to use the executable, then you can modify your config file to look like this:

<packages>
  <package id="Selenium.InternetExplorer.WebDriver" version="3.150.1" targetFramework="net461" />
  <package id="Selenium.Support" version="3.141.0" targetFramework="net461" />
  <package id="Selenium.WebDriver" version="3.141.0" targetFramework="net461" />
  <package id="Selenium.WebDriver.IEDriver" version="3.150.1.2" targetFramework="net461" />
</packages>
Stackedup
  • 517
  • 5
  • 20
  • I matched my config file as you mentioned above but still getting the same error. I am using visual studio 2017 and when I created this project I set as followed: I open visual studio 2017- New project - Visual C# - Windows Desktop- Console App(.NET Framework) not sure if there is anything I missed when I created this project. – Tarishah Dec 09 '20 at 16:40
  • I don't see anything wrong if that is what you have done. I am using VS2019 but I don't believe that has anything to do with the problem. Your error code 0x80131500, might be due to your anti-virus, firewall or your machine. You might want to try your code on a different machine. You might want to also change your port where driver runs.Something similar to this:https://stackoverflow.com/questions/38270270/how-do-you-set-the-port-for-chromedriver-in-selenium – Stackedup Dec 09 '20 at 21:01