Hello!
I wrote the code, launched it. At first everything works well, but then an error occurs.
Error output in the console:
ноя 24, 2016 1:01:26 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init> INFO: executable: C:\Seo-Fast-Bot.beta\SFB.veta\phantomjs-2.1.1- windows\bin\phantomjs.exe ноя 24, 2016 1:01:26 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init> INFO: port: 39550 ноя 24, 2016 1:01:26 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init> INFO: arguments: [--webdriver=39550, --webdriver-logfile=C:\Seo-Fast-Bot.beta\SFB.veta\phantomjsdriver.log] ноя 24, 2016 1:01:26 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init> INFO: environment: {} Exception in thread "main" java.lang.NoSuchFieldError: NEW_SESSION at org.openqa.selenium.remote.HttpCommandExecutor.<init>(HttpCommandExecutor.java:82) at org.openqa.selenium.remote.service.DriverCommandExecutor.<init>(DriverCommandExecutor.java:46) at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:107) at org.openqa.selenium.phantomjs.PhantomJSDriver.<init>(PhantomJSDriver.java:96) at start.main(start.java:13) Code Listing:
import org.openqa.selenium.WebDriver; import org.openqa.selenium.phantomjs.PhantomJSDriver; import org.openqa.selenium.phantomjs.PhantomJSDriverService; import org.openqa.selenium.remote.DesiredCapabilities; public class start { public static void main(String[] args) { DesiredCapabilities caps = new DesiredCapabilities(); caps.setJavascriptEnabled(true); caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "C:\\Seo-Fast-Bot.beta\\SFB.veta\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe"); WebDriver d = new PhantomJSDriver(caps); d.get("http://ww.google.com"); } }