1

I need to open the print window. I have used below code but it's not working.

Keys. Chord(Keys.CONTROL,"p")

I have used another way to click on a random element and used below code.

Driver. findElement(By.id("something")).sendKeys(Keys.Control +"p")

Both are not working. Request to provide the suggestion for this.

Ferrmolina
  • 2,737
  • 2
  • 30
  • 46
PAQuality101
  • 11
  • 1
  • 4

1 Answers1

2

Could you please specify your web browser?

Any way .sendKeys and Actions are not work.

But you can get print message in any browser using JavaScriptExecutor:

 ((JavascriptExecutor)driver).executeScript("window.print()");
Max Kuznietsov
  • 135
  • 1
  • 6