I am trying to use Selenium and PhantomJS in a Maven & Java Project.
Here are the dependencies I use in my pom.xml file:
<dependencies>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>2.53.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server-standalone</artifactId>
<version>2.53.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.github.bonigarcia</groupId>
<artifactId>webdrivermanager</artifactId>
<version>1.4.5</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>jenkins-releases</id>
<url>http://repo.jenkins-ci.org/releases/</url>
</repository>
</repositories>`
In my Java file, I am trying to set up PhantomJS driver without having the JAR file on my computer, using this method :
public void set_up(){
PhantomJsDriverManager.getInstance().setup();
// Configuration du driver
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setJavascriptEnabled(true);
driver = new PhantomJSDriver(capabilities);
}
When I first tried this, it worked well but since a week or two, I am getting this error :
java.lang.RuntimeException: org.openqa.selenium.NoSuchElementException: Unable to locate element with ID: available-downloads
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Driver info: driver.version: HtmlUnitDriver
at io.github.bonigarcia.wdm.BrowserManager.manage(BrowserManager.java:272)
at io.github.bonigarcia.wdm.BrowserManager.setup(BrowserManager.java:103)
at io.github.bonigarcia.wdm.BrowserManager.setup(BrowserManager.java:82)
Does anybody have an idea of what to modify? I am lost and don't know what to do...