Press key - Simulate ESC on the keyboard

Since that preview window does look to overlap with the actual browser window beneath (it goes over your toolbar below the url) - that window is beyond anything that Selenium can interact with. As @aaltat suggested, you need to have some operating system specific way to interact with the keyword to send the esc key press. Maybe robotframework-autoit or hooking up some pyautogui python code to cancel that for you …