How to launch chrome browser in selenium webdriver

In this article we are looking the how to launch chrome browser in selenium webdriver. Selenium webdriver supports multiple browser such as Firefox, Chrome, Internet explorer, Opera etc.

How to launch chrome browser in selenium

webdriver

Many applications are developed based on specific browsers, also some of clients required to use specific browsers to their application.

Suppose Banks are expecting to run their applications on the Internet Explorer due to security concern like that others can do same thing.

Before the selenium script, we see how to download Google chrome driver? from where to download chrome driver?

Download chrome drivers from below URL

https://www.seleniumhq.org/download/

How to launch chrome browser in selenium webdriver

Confirm that chrome driver downloaded in your local drive.

Now we see how to launch chrome browser in selenium webdriver by writing a script.

We assumed that we have created a new class file under particular package in the selenium webdriver.

Open selenium webdriver and follow the below given steps

At first we need to add chrome driver with our class file, so we have to write following script as:

System.setproperty(webdrvier.chrome.driver),(“D:\\cromedriver\chromedriver.exe”);

Now we can write same line in the selenium webdriver. Driver added in the script

 How to launch chrome browser in selenium webdriver

Also Read xpath checker for firefox

Now we see actual how to launch chrome browser in selenium webdriver, we have to write following script

WebDriver driver = new ChromeDriver ();

Now we can write same line in the selenium webdriver and check whether it is working or not

How to launch chrome browser in selenium webdriver

Press ctrl+F11 key to run script

Great!! See the chrome browser successfully lunched using our selenium webdriver script

How to launch chrome browser in selenium webdriver


I will try to provide such a nice article on testingnotes in coming days, so you will get more technical information also provide me your feedback any suggestions regarding this article so I can follow the same in next articles and this is how to launch chrome browser in selenium webdriver.

Thanks for Reading!!

Share This Post

Post Comment