<i id='mlDdo'><tr id='mlDdo'><dt id='mlDdo'><q id='mlDdo'><span id='mlDdo'><b id='mlDdo'><form id='mlDdo'><ins id='mlDdo'></ins><ul id='mlDdo'></ul><sub id='mlDdo'></sub></form><legend id='mlDdo'></legend><bdo id='mlDdo'><pre id='mlDdo'><center id='mlDdo'></center></pre></bdo></b><th id='mlDdo'></th></span></q></dt></tr></i><div id='mlDdo'><tfoot id='mlDdo'></tfoot><dl id='mlDdo'><fieldset id='mlDdo'></fieldset></dl></div>
    1. <tfoot id='mlDdo'></tfoot>

      <small id='mlDdo'></small><noframes id='mlDdo'>

      • <bdo id='mlDdo'></bdo><ul id='mlDdo'></ul>
    2. <legend id='mlDdo'><style id='mlDdo'><dir id='mlDdo'><q id='mlDdo'></q></dir></style></legend>

        Selenium:无法使用 aShot 库获取完整的页面截图

        Selenium: Not able to take complete page screenshot using aShot library(Selenium:无法使用 aShot 库获取完整的页面截图)
        <tfoot id='XAhaY'></tfoot>

      1. <legend id='XAhaY'><style id='XAhaY'><dir id='XAhaY'><q id='XAhaY'></q></dir></style></legend>
              • <bdo id='XAhaY'></bdo><ul id='XAhaY'></ul>
                  <i id='XAhaY'><tr id='XAhaY'><dt id='XAhaY'><q id='XAhaY'><span id='XAhaY'><b id='XAhaY'><form id='XAhaY'><ins id='XAhaY'></ins><ul id='XAhaY'></ul><sub id='XAhaY'></sub></form><legend id='XAhaY'></legend><bdo id='XAhaY'><pre id='XAhaY'><center id='XAhaY'></center></pre></bdo></b><th id='XAhaY'></th></span></q></dt></tr></i><div id='XAhaY'><tfoot id='XAhaY'></tfoot><dl id='XAhaY'><fieldset id='XAhaY'></fieldset></dl></div>
                    <tbody id='XAhaY'></tbody>

                  <small id='XAhaY'></small><noframes id='XAhaY'>

                  本文介绍了Selenium:无法使用 aShot 库获取完整的页面截图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在尝试使用 Firefox gecko 驱动程序和

                  driver.get("https://google.com");截图 fpScreenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).takeScreenshot(driver);ImageIO.write(fpScreenshot.getImage(),"JPEG",new File("FullPageScreenshot.jpg"));

                  查看了很多变体,但没有任何效果.有趣的是,当我尝试使用旧的 Firefox 版本(46)时,我可以在没有任何第三方库的情况下截取完整的屏幕截图.我正在尝试使用最新的 firefox 并拥有完整的屏幕截图功能.

                  有什么帮助吗?

                  解决方案

                  试试:

                  Screenshot screenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(ShootingStrategies.scaling(1.75f), 1000)).takeScreenshot(driver);

                  其中 1.75f 是设备像素比(您可以在浏览器控制台中运行 window.devicePixelRatio; 来找到它).如果仍然没有捕获全屏,请将其更改为 2f

                  Am trying to take the complete page screenshot both horizontally and vertically using Firefox gecko driver and aShot Library.

                  However, the results are not as expected. Take a look:

                  driver.get("https://google.com");
                  
                  Screenshot fpScreenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).takeScreenshot(driver);
                  ImageIO.write(fpScreenshot.getImage(),"JPEG",new File("FullPageScreenshot.jpg"));
                  

                  Looked into a lot of variants but nothing is working. Interestingly, when I try using old firefox version (46), I am able to take full screenshot without any third party library. Am trying to use latest firefox and have full screenshot functionality.

                  Any help?

                  解决方案

                  Try:

                  Screenshot screenshot = new AShot().shootingStrategy(ShootingStrategies.viewportPasting(ShootingStrategies.scaling(1.75f), 1000)).takeScreenshot(driver);
                  

                  where 1.75f is device pixel ratio (you can run window.devicePixelRatio; in browser console to find it). If it's still not capturing full screen, change it to 2f

                  这篇关于Selenium:无法使用 aShot 库获取完整的页面截图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

                  <legend id='zmzu1'><style id='zmzu1'><dir id='zmzu1'><q id='zmzu1'></q></dir></style></legend>
                  • <bdo id='zmzu1'></bdo><ul id='zmzu1'></ul>

                  • <tfoot id='zmzu1'></tfoot>
                      <tbody id='zmzu1'></tbody>

                  • <i id='zmzu1'><tr id='zmzu1'><dt id='zmzu1'><q id='zmzu1'><span id='zmzu1'><b id='zmzu1'><form id='zmzu1'><ins id='zmzu1'></ins><ul id='zmzu1'></ul><sub id='zmzu1'></sub></form><legend id='zmzu1'></legend><bdo id='zmzu1'><pre id='zmzu1'><center id='zmzu1'></center></pre></bdo></b><th id='zmzu1'></th></span></q></dt></tr></i><div id='zmzu1'><tfoot id='zmzu1'></tfoot><dl id='zmzu1'><fieldset id='zmzu1'></fieldset></dl></div>

                          <small id='zmzu1'></small><noframes id='zmzu1'>