Firefox’s driver is part of Mozilla’s Gecko Driver releases. Proxies for all WebDriver-supported browsers are listed on the SeleniumHQ’s list of Third Party Drivers. This example uses Firefox, so you’ll need to grab the appropriate proxy. You’re done! Adding The Firefox Driver ProxyĪs noted in the WebDriver Overview in the first post of this series, you’ll need to have a proxy for your test to talk to the actual browser.
Here’s what the dialog looks like when you’re done. Click the Dependencies tab on the right, then use the “+” icon and add in the directory you saved the Selenium files to-”libs” in this example. Use File => Project Structure to get the Project Structure dialog open, then select the Modules menu on the left. I generally include a “libs” folder in my projects for external libraries like this.ĭepending on your architecture you may need to unzip the zip file. You’ll see that in the sample code below.ĭownload the Java WebDriver bindings and the standalone server (selenium-server-standalone-3.4.0.jar and selenium-java-3.4.0.zip, e.g.) and save them to a handy spot. In this case, download ChromeDriver ‘ve downloaded the zipfile, expanded it, and put it in my “home” directory which is C:\users\matt.
You’ll save the file in a particular directory, then tell the Java code how to find the driver. Firefox, Safari, and InternetExplorer/Edge all have a similar executable file.
The Java code will call this program, and the program will manipulate the browser through it’s automation engine. In the case of Chrome, this is a windows executable file called ChromeDriver.exe. Browse Drive Engineįinally we’ll need to set up the browser driver engine. My adding them to the POM, the project becomes aware of them and can use the code libraries as it they were part of the project. This code adds a new structure, called “dependencies”, and then two dependencies - Junit 5.1 (“Jupiter”) and selenium-java. We’ll add some XML code to the file, after and before. Click import in the bottom-left to add the XML file to your project. The software should bring you to the Maven import XML screen. To do so Right click on the project name in the top-left and click “Add Framework Support”, as in the example below. If you want to use Maven as your dependency manager (and if you don’t know, then use Maven), you’ll need to add it. Give the project a good name and select a directory to store your project.Īt this point you’re at the IntelliJ project’s home. In the next screen leave the Create project from template checkbox cleared and click Next Creating The ProjectĪt startup IntelliJ will prompt you for basic actions-you can choose Create New Project right from the opening screen.įor this example choose the simple Java project with none of the additional library options selected and click Next. Starting IntelliJ the first time will prompt you for various defaults (locations, keyboard mappings, etc.). Installing IntelliJ is a matter of following instructions for the version you’ve downloaded.
This article will use the Community variant on Windows 10 All variants are available for download from IntelliJ’s homepage. Both releases are available on the Mac, Linux, and Windows platforms.
IntelliJ IDEA comes in two releases: Ultimate, a commercial product that supports a wide range of development scenarios, and Community, a free version for Java Virtual Machine and Android development. If you need advice, as of this writing, use Java 8 Windows x84. We’ll skip walking through Java installation in this article since it will vary based on the version you select. There are also different versions for Enterprise, SE, and other Java JRE/JDKs.
WebDriver’s Java bindings require only the Java Runtime Environment (JRE), but you’ll be fine if you have either the Java Development Kit (JDK) or JRE installed. Naturally WebDriver’s Java bindings require a version of Java to be on the system you’re running your tests from.
In this article, we’ll show you how to install it on windows, add all the selenium dependencies, and make a simple Java project that drives a test browser.įor an overview of how WebDriver works, please see the section “WebDriver Overview” in the related article “ Getting Started with Webdriver/Selenium for Java in Eclipse. IntelliJ is a popular, widely used Java Integrated Development Environment (IDE) made by JetBrains.