0

i have used PhantomJS to take screenshot in java and all is perfect but i got this Asynchronous Sessions clean-up phase starting NOW in my console

this error is killing me and i cant found any solutions pls help :/

this is the code :

public class Screenshot {
private PhantomJSDriver driver;


public  void screen () throws IOException {

    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setJavascriptEnabled(true);
    caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "D:\\phantomjs-2.1.1-windows\\bin\\phantomjs.exe");

    this.driver = new PhantomJSDriver(caps);
    driver.get("http://127.0.0.1:18383/webpfe/map2.jsf");
    driver.manage().window().setSize(new Dimension(1200,800));
    File source = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
    FileUtils.copyFile(source, new File ("d:\\test.png"),true);
randominstanceOfLivingThing
  • 16,873
  • 13
  • 49
  • 72
MedBC
  • 11
  • 9

1 Answers1

0

Nearest answer available:

The Asynchronous Sessions cleanup phase starting NOW ... was caused by some calls to external feeds, these were intermittently slow. This phase must have been waiting for these calls, which were timing out, but PhantomJS sat there waiting for a very, very long time.

Removing these calls when testing (with a wee bit of JavaScript, if host is localhost then use a dummy object) solved the problem.

Repeating "Asynchronous Sessions cleanup phase starting NOW"

Community
  • 1
  • 1
Zon
  • 18,610
  • 7
  • 91
  • 99