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
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
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:
Now we can write same line in the selenium webdriver. Driver added in the script
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
Press ctrl+F11 key to run script
Great!! See the chrome browser successfully lunched using our selenium webdriver script
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!!