获取org.openqa.selenium.TimeoutException:超时:超时从渲染器接收消息:10.000

时间:2020-09-22 06:42:55

标签: selenium google-chrome selenium-webdriver selenium-chromedriver

获取org.openqa.selenium.TimeoutException:超时:超时从渲染器接收消息:10.000 在Windows上使用Chrome 85.0.4183.121时,Chrome的浏览器自动从102更新到121,并且出现了此问题。日志看起来像是在截屏时发生的(使用org.openqa.selenium.TakesScreenshot)。 chrome浏览器121发行版有问题吗,因为其发行说明(https://chromereleases.googleblog.com/)确实提到他们试图解决121发行版的存储空间不足的问题,但也许它与硒的集成存在问题?

1 个答案:

答案 0 :(得分:0)

    import org.openqa.selenium.TakesScreenshot;
import org.openqa.selenium.WebDriver;
import ru.yandex.qatools.ashot.AShot;
import ru.yandex.qatools.ashot.Screenshot;
import ru.yandex.qatools.ashot.shooting.ShootingStrategies;
import ru.yandex.qatools.ashot.shooting.ShootingStrategy;

import javax.imageio.ImageIO;
import java.io.File;
import java.io.IOException;

public class Screenshot123 {



    public static void takescreenshot(String filename) throws IOException {
        Screenshot screenshot=new AShot().shootingStrategy(ShootingStrategies.viewportPasting(1000)).takeScreenshot(driver);
         
        

       String dest=System.getProperty("user.dir")+"\\ScreenShots\\";
      
     
        ImageIO.write(screenshot.getImage(),"PNG",new File(dest));
    }
}
相关问题