Using selenium and phantomjs with Maven

Here are the dependencies you will need to use Selenium and PhantomJS with Maven.

		<dependency>
			<groupId>org.seleniumhq.selenium</groupId>
			<artifactId>selenium-java</artifactId>
			<version>2.53.0</version>
		</dependency>
		<dependency>
			<groupId>io.github.bonigarcia</groupId>
			<artifactId>webdrivermanager</artifactId>
			<version>1.4.2</version>
		</dependency>

and in your code call the following

PhantomJsDriverManager.getInstance().setup();

WebDriverManager downloads the latest version of the required PhantomJS binary to be used with Selenium WebDriver.

Leave a Reply

Your email address will not be published. Required fields are marked *