--disable-print-preview Not working

563 views
Skip to first unread message

Prasad Bodke

unread,
Aug 14, 2013, 7:04:01 AM8/14/13
to seleniu...@googlegroups.com, webd...@googlegroups.com
Hi

--disable-print-preview Not working

jdk 1.6.22
webdriver 2.33.0
Chrome Version 28.0.1500.95 m

capabilities = DesiredCapabilities.chrome();
capabilities.setCapability("chrome.switches", Arrays.asList("--disable-print-preview"));



--
Prasad Bodke
9320675131

darrell

unread,
Aug 15, 2013, 11:12:54 AM8/15/13
to webd...@googlegroups.com, seleniu...@googlegroups.com
Prasad,

The chrome.switches feature allows you to pass command line switches to Chrome. If you can go to the command line and enter:

    chrome.exe --disable-print-preview

then manually do the actions your Selenium code is doing you will see what is happening. It really has little to do with Selenium and more to do with Chrome and command line switches. So trying this manually would be my first step. If it doesn't work manually then there is no way you are going to get it working with Selenium.

If it works when I do it manually then I'd look to see if the manual steps I'm doing in Selenium are the same as the steps I did manually. Maybe I'm missing a step in the Selenium code and I don't even realize it. If you confirm it works manually and you are still having problems then we might be able to help.

As others have been asking, why are you even clicking the link? If it open a print dialog, Selenium cannot control system dialogs like print, file open, etc. Clicking anything which opens a system dialog hangs your test until human intervention occurs. So you just shouldn't do it.

Darrell
Reply all
Reply to author
Forward
0 new messages