解决方案:https://stackoverflow.com/questions/49728477/robot-class-without-focus-on-browser-window-in-webdriver 下一步该选择打印方式了。 转载于:https://my.oschina.net/macleo/blog/3081818