Selenium java + PhantomJS - phantomjs: //platform/console++.js: 263 by mistake

I tried to run selenium with a browser without phantomjs headers and get the error message "phantomjs: //platform/console++.js: 263 in error".

I searched through the Internet, but did not get any solution, so please here.

The same code and solution that do not work for me Link

Why am I getting this error message ?, is it a phantomjs or selenium problem ?. Let me know how to solve it?

Configuration:

1) Selenium 2.53.1.jar

2) Phantomjs 2.1.1.exe

3) Junit4

The code:

private PhantomJSDriver driver; private String baseUrl; @Before public void setUp() throws Exception { // File file = new File("D:/Selenium/Drivers/phantomjs.exe"); // System.setProperty("phantomjs.binary.path", file.getAbsolutePath()); System.setProperty("phantomjs.binary.path", "D:/Selenium/Drivers/phantomjs.exe"); Capabilities caps = new DesiredCapabilities(); ((DesiredCapabilities) caps).setJavascriptEnabled(true); ((DesiredCapabilities) caps).setCapability("takesScreenshot", true); //((DesiredCapabilities) caps).setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "D:/Selenium/Drivers/phantomjs.exe"); WebDriver driver = new PhantomJSDriver(caps); driver = new PhantomJSDriver(); baseUrl = "http://www.gts.fiorentina.test/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.get(baseUrl + "/Account/Login.aspx?ReturnUrl=%2f"); driver.findElement(By.id("tbUserName_I")).clear(); driver.findElement(By.id("tbUserName_I")).sendKeys("rogai"); driver.findElement(By.id("tbPassword_I")).clear(); driver.findElement(By.id("tbPassword_I")).sendKeys("Fiorentina2014!"); driver.findElement(By.id("btnLogin_CD")).click(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } @Test public void testCreazione() throws Exception { driver.get(baseUrl + "/SegreteriaSportiva/Calciatori.aspx"); driver.findElement(By.cssSelector("#ASPxButton1_CD > span")).click(); driver.findElement(By.id("FrmEdit_TS_TipoPersonaId_FK_B-1")).click(); driver.findElement(By.id("FrmEdit_TS_TipoPersonaId_FK_DDD_L_LBI2T0")).click(); driver.findElement(By.id("FrmEdit_Nome_I")).clear(); driver.findElement(By.id("FrmEdit_Nome_I")).sendKeys("Prova"); driver.findElement(By.id("FrmEdit_Cognome_I")).clear(); driver.findElement(By.id("FrmEdit_Cognome_I")).sendKeys("Calciatore"); driver.findElement(By.id("FrmEdit_TS_RuoloId_FK_B-1")).click(); driver.findElement(By.id("FrmEdit_TS_RuoloId_FK_DDD_L_LBI3T0")).click(); driver.findElement(By.id("FrmEdit_DataNascita_I")).clear(); driver.findElement(By.id("FrmEdit_DataNascita_I")).sendKeys("01/01/2014"); driver.findElement(By.id("FrmEdit_Cittadinanza_I")).clear(); driver.findElement(By.id("FrmEdit_Cittadinanza_I")).sendKeys("italiana"); driver.findElement(By.id("FrmEdit_LuogoNascita_I")).clear(); driver.findElement(By.id("FrmEdit_LuogoNascita_I")).sendKeys("roma"); driver.findElement(By.cssSelector("#BTN_Edit_CD > span")).click(); driver.findElement(By.id("Grid_DXFREditorcol3_I")).click(); driver.findElement(By.id("Grid_DXFREditorcol3_I")).sendKeys("Prova"); } 

Error message:

  INFO: environment: {} [INFO - 2016-11-15T00:41:42.115Z] GhostDriver - Main - running on port 20668 [INFO - 2016-11-15T00:41:42.955Z] Session [4766f980-aacc-11e6-a7fd-efd8c5848edd] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Windows NT 6.1) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1","webSecurityEnabled":true} [INFO - 2016-11-15T00:41:42.955Z] Session [4766f980-aacc-11e6-a7fd-efd8c5848edd] - page.customHeaders: - {} [INFO - 2016-11-15T00:41:42.956Z] Session [4766f980-aacc-11e6-a7fd-efd8c5848edd] - 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 - 2016-11-15T00:41:42.956Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 4766f980-aacc-11e6-a7fd-efd8c5848edd [ERROR - 2016-11-15T00:42:27.341Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1479170547300 phantomjs://platform/console++.js:263 in error 
+7
selenium phantomjs selenium-webdriver headless-browser
source share

No one has answered this question yet.

See similar questions:

6
How to implement PhantomJS using Selenium WebDriver using java

or similar:

137
Casperzh / Phantoms vs Selena
6
Selenium: org.openqa.selenium.NoSuchWindowException: closed window currently closed
3
OpenQA.Selenium.NoSuchElementException was unhandled + C # + Another website
one
PhantomJS selenium NoSuchElementException
0
Item is not clickable - Error starting Selenium testcases
0
phantomjs: // platform /console++.js: 263 by mistake
0
How to run more tests by loading logins in a database or excel webdriver selenium
0
sendKeys () on Selenium WebDriver when using PhantomJS driver does not work
0
PhantomJS launches GhostDriver but closes it after creating a new session
-one
PhatntomJs with Selenium cannot start a session

All Articles