셀레늄 프로젝트에서 캡처하여 저장 한 스크린 샷을 테스트 자동화 보고서 범위에 첨부하려고하면 java.io.IOException : Media was not found at [C : \ Users \ Suresh \ git \ BasicFuncTesting \ test- output \ Screenshot \ imageOneBrokenTest.png]
내 이미지 경로를 아래와 같이 지정했습니다.
String imagePath = "C:\\Users\\Suresh\\git\\BasicFuncTesting\\test-output\\Screenshot\\imageOneBrokenTest.png";
이 스크린 샷을 첨부하기 위해 아래와 같이 두 가지 방법을 사용했지만 두 방법 모두 동일한 오류가 발생합니다.
logger.addScreenCaptureFromPath(imagePath, "Fail");
logger.fail("Screenshot", MediaEntityBuilder.createScreenCaptureFromPath(imagePath).build());
여기서 로거는 ExtentTest 개체입니다.
아래와 같이 변수 값을 설정하여 캡처 한 스크린 샷으로 익스텐트 보고서를 성공적으로 생성 할 수있었습니다.
String imagePath = "C:/Users/Suresh/git/BasicFuncTesting/BasicFuncTesting/test-output/Screenshot/1587494732758.png";
try {
logger.fail("Screenshot", MediaEntityBuilder.createScreenCaptureFromPath(imagePath).build());
} catch (Exception e) {
e.printStackTrace();
}
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다