0

How to disable print option in selenium using selenium using java?

```public void RxPackingList() throws InterruptedException {
driver.findElement(By.xpath("//div[@class='menu_icon eye']")).click();
driver.findElement(By.xpath("//a[@href='#/orderlist/orderDetails/298270/']")).click();
driver.findElement(By.xpath("//span[@data-original-title='Invoice & PL']")).click();
Thread.sleep(3000);
WebElement lens1 = driver.findElement(By.xpath("//a[text()='Packing Lists']"));
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("arguments[0].click();", lens1);

driver.findElement(By.xpath("//button[@ng-click='printInvoice()']")).click(); driver.findElement(By.xpath("//button[@ng-click='printInvoice()']")).click(); ```

  • You might try removing all printers from your system. Or, check this post to set the browser to print to file: https://stackoverflow.com/questions/56897041/how-to-save-opened-page-as-pdf-in-selenium-python – pcalkins Dec 27 '21 at 21:42

0 Answers0