Handling print dialog in Selenium WebDriver

0 votes

I have to handle print dialog, which appears by clicking [CLTR+P] inside the browser). 

I tried it using the below code:

Alert print = driver.switchTo().alert();
print.dismiss();

But this code was not working for me. How to handle these objects?

May 11, 2018 in Selenium by ana1504.k
• 7,910 points
7,584 views

1 answer to this question.

0 votes

In Selenium WebDriver we are not able to handle these. 

Alos, they are different across different Browsers/ Systems/ Programming Language settings, that's why there is no definite answer to this question.

It would be better if you can avoid the print dialog and try to take the screenshot of the page and print it using the Java tools.

answered May 11, 2018 by Meci Matt
• 9,460 points

Related Questions In Selenium

0 votes
1 answer

Handling JavaScript Alert window in Selenium WebDriver

You should try using waits for alerts ...READ MORE

answered Apr 10, 2018 in Selenium by ghost
• 1,790 points
2,149 views
0 votes
1 answer

How to do session handling in Selenium Webdriver?

Hey Lalita, you can perform following steps ...READ MORE

answered Jun 20, 2019 in Selenium by Subhash
11,054 views
0 votes
1 answer
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
12,746 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,618 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,910 points
6,696 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 3, 2020 in Selenium by Sri
• 3,190 points
7,559 views
0 votes
1 answer

Handling pop up in Chrome using Selenium WebDriver

AutoIt Window Information Tool do not recognize ...READ MORE

answered Jun 11, 2018 in Selenium by Meci Matt
• 9,460 points
2,694 views
0 votes
1 answer

Handling elements inside Shadow DOM in Selenium WebDriver

You can use the driver.executeScript() method to access the ...READ MORE

answered Jun 11, 2018 in Selenium by Meci Matt
• 9,460 points
8,036 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP