Unable to click on the Print button in chrome browser

I am working on a web based automation.

In the web page, i have option to click on the “Print” and when i click on the Print, a pop up window appears to print the page and its has “Print / Save” and “Cancel” option,

But here is the problem: I couldn’t click on the “Print / Save” and “Cancel” options with RF.

I have tried,

  1. Send Keys None RETURN
  2. Click element

But no result. Need assistance please

Hi Harpreet,

You could try using Handle Alert (assuming you are using SeleniumLibrray, you didn’t say??), failing that you might need to resort to a desktop automation library like one of these


*** Settings ***

Library SeleniumLibrary
Library String
Library Collections
Library OperatingSystem
Library DateTime

*** Variables ***

*** Test Cases ***
Should be able to print the dashboads
[Documentation] Download the report from Qualys
#robot -d results .\Tests\qualys.robot
log Starting the test case
open browser Creating a Print Button chrome
sleep 5s
maximize browser window
click element xpath=//*[@id=“main”]/div[2]/div/button
sleep 2s
press keys None ENTER

Hi Dave,

Thank you for the reply

---- Thisis the code i am trying to run. When i hit the Print button, a pop up appear for “Print Preview” and the script actually go to executing status for long time and it never go to the next line of code which is “press keys None ENTER”.

If you just want to confirm the Printing automatically, I recommend to look into the –kiosk-printing argument in Chrome.
The issue below is from Playwright, but the chrome option is also available if you are using Selenium.
Using that option will confirm the Printing automatically. So the Print Dialog will not pop up.


I am just looking to hit the “Print button / Save button” automatically. The xpath doesn’t work for me.

If you use the kiosk printing mode in chrome, this dialog will be handled automatically by the browser and no additional steps to click the buttons will be needed

Hi Harpreet,

I have no real experience with this, I do remember there was a post in the forum a while back (can’t find it now) where the person solved the problem using SikuliLibrary

Here are a couple of threads I found that are related:

Hopefully that helps?


Thank you Dave, I will have a look.

1 Like