rdp 세션이 닫힐 때 검은 스크린 샷이 나타나는 일반적인 문제가 있습니다. 이 문제에 대한 답변을 찾지 못했습니다. java-selenium 테스트가 있습니다. 코드 : 나는 이을 폐쇄 원격 서버 (윈도우 서버 2008 R2) 및 RDP 세션에 젠킨스를 통해 테스트를 실행하면원격 컴퓨터에서 robot.createScreenCapture로 검은 색 이미지 가져 오기
private void screenShot() {
try {
String newFileNamePath;
File directory = new File (".");
DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd_HHmmss");
Date date = new Date();
newFileNamePath = directory.getCanonicalPath() + "\\test-output\\" + "logs\\" + "screenshot_" + dateFormat.format(date) + ".png";
System.out.println(newFileNamePath);
//Capture the screen shot of the area of the screen defined by the rectangle
Robot robot = new Robot();
BufferedImage bi=robot.createScreenCapture(new Rectangle(1920,1080));
ImageIO.write(bi, "png", new File(newFileNamePath));
Reporter.log(newFileNamePath);
}
catch (AWTException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
}
, 나는 검은 스크린 샷을 얻을. 세션이 활성화되어 있으면 정상적인 스크린 샷을 얻습니다. 하지만 세션이 닫힐 때 정상적인 스크린 샷을 만들어야합니다.
어떻게 만들 수 있습니까? 아이디어가 있으십니까?
VisualCron 및 selenium.captureScreenshot()은 저에게 적합하지 않습니다.
같은 문제가 있습니다. Windows 2003에서는/console login과'tscon 0/dest : console'을 연결 해제 할 수 있습니다. VNC를 사용하는 것이 해결책이지만, 나는 그렇지 않을 것입니다. – Dormouse