Want to run your selenium script on Chrome browser. See the solution below:
Step1: Download Chrome webdriver
Download this driver
from here and put this driver exe
at a particular location(like i put in "E:\")
Step2: Code to use this driver
using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium;
namespace UnitTestProject2
{
[TestClass]
public class UnitTest1
{
[TestMethod]
public void TestMethod1()
{
IWebDriver driver = new ChromeDriver(@"E:\");
driver.Navigate().GoToUrl("https://www.google.co.in");
}
}
}
No comments:
Post a Comment