Skip to content

Commit 5784233

Browse files
committed
Optimized PDF report generation
1 parent 6a3bd75 commit 5784233

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

web-pdf/src/main/java/com/utmstack/webtopdf/service/PdfGenerationService.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,8 @@ public byte[] generatePdf(String url, String route, String accessKey, AccessType
3737

3838
try {
3939
webDriver.get(reportUrl);
40-
41-
WebDriverWait wait = new WebDriverWait(webDriver, Duration.ofSeconds(30));
42-
wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(".report-loading")));
43-
44-
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector(".report-loading")));
40+
WebDriverWait wait = new WebDriverWait(webDriver, Duration.ofSeconds(10));
41+
wait.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector(".report-loading")));
4542

4643
Pdf print = ((PrintsPage) webDriver).print(printOptions);
4744
webDriver.quit();

0 commit comments

Comments
 (0)