Open url using Selenium Chromedriver c#

This is a simple example to show how to navigate to url using selenium chromedriver

Install selenium webdriver using Nuget Package

PM> Install-Package Selenium.WebDriver.ChromeDriver -Version 80.0.3987.10600

Below code performs a navigation to

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium;
using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Support.UI;
using System.Collections.ObjectModel;
using System.Threading;
using System.Configuration;

namespace OpenURL
    class Program
        static void Main(string[] args)
            IWebDriver driver = null;

                //driver = new ChromeDriver(@"c:\temp\");//load chromedriver from desired folder.
                driver = new ChromeDriver(AppDomain.CurrentDomain.BaseDirectory);//load chromedriver from bin folder as nuget package deploys chrome driver .exe and other dlls into bin
                driver.Url = "";//Set the url you would like to navigate
            catch (Exception e)
                Console.WriteLine("Exception" + e.ToString());


Use bin or desired folder to load chrome driver

 driver = new ChromeDriver(AppDomain.CurrentDomain.BaseDirectory);
//this helps loading chromedriver from bin folder
driver = new ChromeDriver(@"c:\temp\");
//this helps to load chromdriver.exe from temp folder.