在远程计算机上运行代码时,如何获取硒中的浏览器警报屏幕快照

时间:2019-09-19 09:33:24

标签: selenium google-chrome alert

我正在尝试获取浏览器警报的屏幕截图。

我尝试使用Robot类

BufferedImage image = new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
    ImageIO.write(image, "png", new File("c:\\localdev\\bla.png"));

The problem is i am running code on remote machine and Robot class captures screenshot of part of my local machine which is currently in focus.

0 个答案:

没有答案