
If the path doesn't exist, Chrome will create a new profile in the specified location. You can create your own custom profile by just running Chrome (on the command-line or through ChromeDriver) with the user-data-dir switch set to some new directory. Options.addArguments(" user-data-dir=/path/to/your/custom/profile ") If the latter, you can use the user-data-dir Chrome command-line switch to tell Chrome which profile to use:ĬhromeOptions options = new ChromeOptions() If the former, you can use the 'chrome.prefs' capability (described later below) to specify preferences that will be applied after Chrome starts. At times you may want to set special preferences or just use a custom profile altogether. Set a system property "" to the path of your ChromeDriver.exe file and instantiate a ChromeDriver class.Use custom profile (also called user data directory)īy default, ChromeDriver will create a new temporary profile for each session. Unpack the contents in a convenient directory. The downloaded file would be in zipped format. Download as per the operating system you are working currently on.įor windows, click on the "chromedriver_win32.zip" download. It will redirect you to the directory of ChromeDriver executables files. Give your Class name as "Third" and click on "Finish" button. Right click on the "src" folder and create a new Class File from New > Class. We will create our third test case in the same test suite (Demo_Test). Click on "Core Java" link from the Java Technology section.Let us consider a test case in which we will try to automate the following scenarios in Google Chrome browser. This executable start a server on your system which in turn is responsible for running your test scripts in Selenium.



In this section, you will learn how to run your Selenium Test Scripts on Chrome Browser.Ĭhrome browser implements the WebDriver protocol using an executable called ChromeDriver.exe. Next → ← prev Selenium WebDriver- Running test on Chrome Browser
