I have a simple automation selenium code which visits a website and performs a login operation....
WebDriver driver = new PhantomJSDriver();
driver.manage().window().maximize();
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get("http://upload4earn.org/");
TimeUnit.SECONDS.sleep(15);
driver.findElement(By.xpath("//input[@value='Username']")).sendKeys("Jorge");
driver.findElement(By.xpath("//input[@value='Password']")).sendKeys("test123456");
driver.findElement(By.xpath("//input[@value='Submit']")).click();
TimeUnit.SECONDS.sleep(3);
So after running the script i'm getting the following error
Feb 06, 2019 11:55:21 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: executable: C:\Users\Nigga\eclipse-workspace\HeadLessBrowser\phantomjs.exe
Feb 06, 2019 11:55:21 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: port: 40366
Feb 06, 2019 11:55:21 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: arguments: [--webdriver=40366, --webdriver-logfile=C:\Users\Nigga\eclipse-workspace\HeadLessBrowser\phantomjsdriver.log]
Feb 06, 2019 11:55:21 PM org.openqa.selenium.phantomjs.PhantomJSDriverService <init>
INFO: environment: {}
[INFO - 2019-02-06T18:25:25.325Z] GhostDriver - Main - running on port 40366
[INFO - 2019-02-06T18:25:25.960Z] Session [92b8f4f0-2a3c-11e9-844e-25707495b5e3] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1","webSecurityEnabled":true}
[INFO - 2019-02-06T18:25:25.960Z] Session [92b8f4f0-2a3c-11e9-844e-25707495b5e3] - page.customHeaders: - {}
[INFO - 2019-02-06T18:25:25.961Z] Session [92b8f4f0-2a3c-11e9-844e-25707495b5e3] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.1.1","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"windows-7-32bit","javascriptEnabled":true,"takesScreenshot":true,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyType":"direct"}}
[INFO - 2019-02-06T18:25:25.961Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 92b8f4f0-2a3c-11e9-844e-25707495b5e3
[ERROR - 2019-02-06T18:25:30.524Z] Session [92b8f4f0-2a3c-11e9-844e-25707495b5e3] - page.onError - msg: ReferenceError: Can't find variable: EventTarget
phantomjs://platform/console++.js:263 in error
[ERROR - 2019-02-06T18:25:30.525Z] Session [92b8f4f0-2a3c-11e9-844e-25707495b5e3] - page.onError - stack:
setupEventListenerProxy (https://ajax.cloudflare.com/cdn-cgi/scripts/cb7744ae/cloudflare-static/rocket-loader.min.js:1)
t (https://ajax.cloudflare.com/cdn-cgi/scripts/cb7744ae/cloudflare-static/rocket-loader.min.js:1)
(anonymous function) (https://ajax.cloudflare.com/cdn-cgi/scripts/cb7744ae/cloudflare-static/rocket-loader.min.js:1)
(anonymous function) (https://ajax.cloudflare.com/cdn-cgi/scripts/cb7744ae/cloudflare-static/rocket-loader.min.js:1)
phantomjs://platform/console++.js:263 in error
[ERROR - 2019-02-06T18:25:42.108Z] Session [92b8f4f0-2a3c-11e9-844e-25707495b5e3] - page.onError - msg: TypeError: undefined is not a constructor (evaluating 'c[Y('0x42')](0,12)')
phantomjs://platform/console++.js:263 in error
[ERROR - 2019-02-06T18:25:42.109Z] Session [92b8f4f0-2a3c-11e9-844e-25707495b5e3] - page.onError - stack:
(anonymous function) (https://upload4earn.org/:420)
phantomjs://platform/console++.js:263 in error
[ERROR - 2019-02-06T18:25:54.154Z] Session [92b8f4f0-2a3c-11e9-844e-25707495b5e3] - page.onError - msg: ReferenceError: Can't find variable: EventTarget
phantomjs://platform/console++.js:263 in error
[ERROR - 2019-02-06T18:25:54.155Z] Session [92b8f4f0-2a3c-11e9-844e-25707495b5e3] - page.onError - stack:
setupEventListenerProxy (https://ajax.cloudflare.com/cdn-cgi/scripts/cb7744ae/cloudflare-static/rocket-loader.min.js:1)
t (https://ajax.cloudflare.com/cdn-cgi/scripts/cb7744ae/cloudflare-static/rocket-loader.min.js:1)
(anonymous function) (https://ajax.cloudflare.com/cdn-cgi/scripts/cb7744ae/cloudflare-static/rocket-loader.min.js:1)
(anonymous function) (https://ajax.cloudflare.com/cdn-cgi/scripts/cb7744ae/cloudflare-static/rocket-loader.min.js:1)
phantomjs://platform/console++.js:263 in error
I tried this script with chrome webdriver and it's working fine and i also checked that if javascript is enabled or not and it is enabled by default, also added 15 second sleep to wait if there's cloudflare is checking for ddos. And also tried checking on web for solution but couldn't find any solution for that.