I am trying to tap on the 'cancel' option in the print preview page in Firefox. But unfortunately, I am not able to inspect the element on right clicking on the cancel option. I was able to inspect in chrome though and was able to see the shadow root element. The following code worked perfectly for chrome, but not working in firefox.
switch window NEW
execute javascript ${cancel_link}.click()
where ${cancel_link} is the shadow root element pointing to the "cancel option"
Seems like there is no direct answer for the above scenario in selenium. Had to use "rpaframework" library to enter the "tab key" and finally reach the desired option in the print preview page.
https://robocorp.com/docs/libraries/rpa-framework/rpa-desktop/keywords