2

Using phantomjs com.codeborne:phantomjsdriver:1.2.1, selenium 2.49 and browserMob Proxy browsermob-proxy-2.0-beta-9. Testing on Mac works fine. Testing same settings(capabilities) on Linux 64bit with the right executable gets stuck with the following message. This happens for urls with HTTPS.

[INFO  - 2016-02-15T19:45:00.917Z] GhostDriver - Main - running on port 1548
[INFO  - 2016-02-15T19:45:00.971Z] Session [99d42c60-d41c-11e5-bf2d-2b2a3425f04c] - page.settings - {"XSSAuditingEnabled":false,"javascriptCanCloseWindows":true,"javascriptCanOpenWindows":true,"javascriptEnabled":true,"loadImages":true,"localToRemoteUrlAccessEnabled":false,"userAgent":"Mozilla/5.0 (Unknown; Linux x86_64) AppleWebKit/538.1 (KHTML, like Gecko) PhantomJS/2.1.1 Safari/538.1","webSecurityEnabled":false}
[INFO  - 2016-02-15T19:45:00.975Z] Session [99d42c60-d41c-11e5-bf2d-2b2a3425f04c] - page.customHeaders:  - {}
[INFO  - 2016-02-15T19:45:00.975Z] Session [99d42c60-d41c-11e5-bf2d-2b2a3425f04c] - Session.negotiatedCapabilities - {"browserName":"phantomjs","version":"2.1.1","driverName":"ghostdriver","driverVersion":"1.2.0","platform":"linux-unknown-64bit","javascriptEnabled":true,"takesScreenshot":false,"handlesAlerts":false,"databaseEnabled":false,"locationContextEnabled":false,"applicationCacheEnabled":false,"browserConnectionEnabled":false,"cssSelectorsEnabled":true,"webStorageEnabled":false,"rotatable":false,"acceptSslCerts":false,"nativeEvents":true,"proxy":{"proxyAutoconfigUrl":null,"autodetect":false,"socksUsername":null,"socksPassword":null,"httpProxy":"54.86.251.172:13007","proxyType":"MANUAL","noProxy":null,"ftpProxy":"54.86.251.172:13007","socksProxy":null,"hCode":437462540,"class":"org.openqa.selenium.Proxy","sslProxy":"54.86.251.172:13007"}}
[INFO  - 2016-02-15T19:45:00.975Z] SessionManagerReqHand - _postNewSessionCommand - New Session Created: 99d42c60-d41c-11e5-bf2d-2b2a3425f04c
[INFO  - 2016-02-15T19:45:07.273Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO  - 2016-02-15T19:47:02.432Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO  - 2016-02-15T19:49:00.725Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW
[INFO  - 2016-02-15T19:49:01.464Z] SessionManagerReqHand - _cleanupWindowlessSessions - Asynchronous Sessions clean-up phase starting NOW

When I look at the process it shows up as

tomcat7   5685  0.8  0.3 1372232 23692 ?       Sl   19:26   0:19 /phantomjs-2.1.1-linux-x86_64/bin/phantomjs --proxy-type=http --proxy=54.86.251.172:13009 --web-security=no --ssl-protocol=tlsv1 --ignore-ssl-errors=yes --webdriver=20785 --webdriver-logfile=/var/lib/tomcat7/phantomjsdriver.log

Suggestions here did not work for me.

PhantomJS hangs for a long time saying "Asynchronous Sessions clean-up phase starting NOW"

Repeating "Asynchronous Sessions cleanup phase starting NOW"

Following are the capabilities

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setJavascriptEnabled(true);
capabilities.setCapability("takesScreenshot", false);
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
capabilities.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, new String[] {"--web-security=no", "--ssl-protocol=any", "--ignore-ssl-errors=yes"});
capabilities.setCapability("phantomjs.binary.path", this.phantomjsPath);

WebDriver webDriver = new PhantomJSDriver(capabilities);

For urls with HTTP, it goes through, however the HAR that I wish to capture is always empty.

{"log":{"creator":{"name":"BrowserMob Proxy","comment":"","version":"2.0"},"entries":[],"pages":[{"startedDateTime":"2016-02-15T21:58:00.996+0000","pageTimings":{"comment":""},"comment":"","id":"Page 1","title":""}],"comment":"","version":"1.2"}}

Please do not disregard this questions as a duplicate as I have looked and tried suggestions from similar other questions but none have worked. Would be helpful to understand what is going on and how to solve this.

Programmer
  • 165
  • 2
  • 15

0 Answers0