Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
870 views
in Technique[技术] by (71.8m points)

how to solve Selenium ChromeDriver Timed out receiving message from renderer exception

I'm getting the below error while page transition, by clicking on submit button. It looks like there was an issue with the newest Chrome release. Without the disable-gpu Chromeoption set, the renderer will occasionally timeout. The workaround until Google fixes this (if they do fix it at all) is to add the --disable-gpu attribute to the ChromeOptions.

Launching the chrome driver  
Starting ChromeDriver 2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e) on port 8737
Only local connections are allowed.
Aug 22, 2018 10:02:06 AM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
[1534912350.875][SEVERE]: Timed out receiving message from renderer: 20.000
[1534912350.881][SEVERE]: Timed out receiving message from renderer: -0.010
iiiiiiiiiiiiiiiiiii
[1534912370.909][SEVERE]: Timed out receiving message from renderer: 20.000
[1534912370.909][SEVERE]: Timed out receiving message from renderer: -0.001
Exception in thread "main" org.openqa.selenium.TimeoutException: timeout
  (Session info: chrome=68.0.3440.106)
  (Driver info: chromedriver=2.41.578737 (49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 10.0.17134 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:05:20.749Z'
System info: host: 'LAPTOP-B3DIN1KF', ip: '192.168.43.235', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_161'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.41.578737 (49da6702b16031..., userDataDir: C:UsersACER-S~1AppDataL...}, cssSelectorsEnabled: true, databaseEnabled: false, goog:chromeOptions: {debuggerAddress: localhost:49380}, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 68.0.3440.106, webStorageEnabled: true}
Session ID: b3de58666d2ca24706dc70a9d78094e4
*** Element info: {Using=css selector, value=body > div > div > div > h1 > a}
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
    at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
    at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
    at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:322)
    at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:416)
    at org.openqa.selenium.By$ByCssSelector.findElement(By.java:431)
    at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:314)
    at demoPackage.Demo.main(Demo.java:102)






package demoPackage;

    import java.util.concurrent.TimeUnit;

    import org.openqa.selenium.By;
    import org.openqa.selenium.JavascriptExecutor;
    import org.openqa.selenium.Keys;
    import org.openqa.selenium.Point;
    import org.openqa.selenium.WebDriver;
    import org.openqa.selenium.WebElement;
    import org.openqa.selenium.chrome.ChromeDriver;
    import org.openqa.selenium.chrome.ChromeOptions;
    import org.openqa.selenium.edge.EdgeDriver;
    import org.openqa.selenium.remote.DesiredCapabilities;
    import org.openqa.selenium.support.ui.ExpectedConditions;
    import org.openqa.selenium.support.ui.WebDriverWait;

    import com.codoid.products.exception.FilloException;

    /**
     * @author Acer-sumit
     * 
     */
    public class Demo {

        public static WebDriver driver = null;
        public static JavascriptExecutor js;

        public static void main(String args[]) throws FilloException, InterruptedException {



            System.out.println("Launching the chrome driver  ");
            // Set the chrome driver exe file path
            System.setProperty("webdriver.chrome.driver","E:\selenium_sumit\chromedriver_win32_2.40\chromedriver.exe");
            ChromeOptions options = new ChromeOptions();
            options.addArguments("--disable-gpu");
            options.addArguments("--disable-browser-side-navigation");

            // Instantiate the chrome driver
            driver = new ChromeDriver(options);

            ///System.setProperty("webdriver.edge.driver","E:\MicrosoftWebDriver.exe");
            //driver = new EdgeDriver();


            //driver.manage().timeouts().implicitlyWait(6000, TimeUnit.MILLISECONDS);
            driver.manage().timeouts().pageLoadTimeout(20,TimeUnit.SECONDS);
            //driver.manage().timeouts().setScriptTimeout(60, TimeUnit.SECONDS);
            // set the browser URL in get() to load the webpage

            try {

                driver.navigate().to("https://diggza.com/");
                driver.findElement(By.cssSelector("input[name='url']")).clear();
                driver.findElement(By.cssSelector("input[name='url']")).sendKeys("https://www.google.com/");
                driver.findElement(By.cssSelector("input[name='email']")).sendKeys("sdsjsnssk@gmail.com");
                driver.findElement(By.cssSelector("#myform > p:nth-child(5) > a:nth-child(1)")).click();

                //wait for element to be visible and perform click
                //wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[type='submit']")));


                    js = (JavascriptExecutor)driver;
                    js.executeScript("arguments[0].click();", driver.findElement(By.cssSelector("input[type='submit']")));
                } catch (Exception e) {
                    // TODO Auto-generated catch block
                    System.out.println("iiiiiiiiiiiiiiiiiii");
                    driver.findElement(By.cssSelector("body > div > div > div > h1 > a")).click();
                    //driver.navigate().refresh();


                }

            //driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

            System.out.println("-------fffffffffff---------");
            driver.get("https://diggza.com/");

            driver.findElement(By.cssSelector("input[name='url']")).clear();
            driver.findElement(By.cssSelector("input[name='url']")).sendKeys("https://www.google.com/");
            driver.findElement(By.cssSelector("input[name='email']")).sendKeys("sumit.pradhan96@gmail.com");
            driver.findElement(By.cssSelector("#myform > p:nth-child(5) > a:nth-child(1)")).click();

            //wait for element to be visible and perform click
            //wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("input[type='submit']")));
            driver.findElement(By.cssSelector("input[type='submit']")).click();
            //driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);


        }   



    }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...