Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

Error [SEVERE]: Timed out receiving message from renderer: 20.000 while executing the testsuite through Selenium on Jenkins

I use ChromeDriver with Selenium to run my automated tests. The test suite runs successfully in both Eclipse and command line. However, it does not run when I try to build it in Jenkins.

This is my job config in Jenkins (all info has names sanitized for confidentiality): enter image description here I can confirm it's Ant is running JDK8.

This is the console output of the build:

[junit] Running main.TESTNAME
    [junit] Starting ChromeDriver 2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f) on port 27352
    [junit] Only local connections are allowed.
    [junit] Apr 26, 2018 3:52:34 PM org.openqa.selenium.remote.ProtocolHandshake createSession
    [junit] INFO: Detected dialect: OSS
    [junit] Running through test suite as:
    [junit] User: USERNAME
    [junit] URL: CONFIDENTIAL
    [junit] [30.168][SEVERE]: Timed out receiving message from renderer: 20.000
    [junit] [30.170][SEVERE]: Timed out receiving message from renderer: -0.003
    [junit] Total number of tests ran for TESTNAME: 5, Number of tests failures: 4, Number of tests ignored: 0
    [junit] testViewProfileDetailsButtonAndBrowseBack(test.TESTNAME): timeout
    [junit]   (Session info: chrome=64.0.3282.119)
    [junit]   (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.14393 x86_64) (WARNING: The server did not provide any stacktrace information)
    [junit] Command duration or timeout: 0 milliseconds
    [junit] Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:14.666Z'
    [junit] System info: host: 'PC', ip: 'IP', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_151'
    [junit] Driver info: org.openqa.selenium.chrome.ChromeDriver
    [junit] Capabilities {acceptSslCerts: true, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.33.506120 (e3e53437346286..., userDataDir: C:WINDOWSTEMPscoped_dir1...}, cssSelectorsEnabled: true, databaseEnabled: false, 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: 64.0.3282.119, webStorageEnabled: true}

My build.xml below is mostly auto-generated except for the end where I added JUnit integration:

<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="build" name="PROJECTSeleniumTest">
<property environment="env"/>
<property name="debuglevel" value="source,lines,vars"/>
<property name="target" value="1.8"/>
<property name="source" value="1.8"/>
<path id="PROJECTSeleniumTest.classpath">
    <pathelement location="bin"/>
    <pathelement location="lib/byte-buddy-1.7.5.jar"/>
    <pathelement location="lib/client-combined-3.8.1-sources.jar"/>
    <pathelement location="lib/client-combined-3.8.1.jar"/>
    <pathelement location="lib/commons-codec-1.10.jar"/>
    <pathelement location="lib/commons-exec-1.3.jar"/>
    <pathelement location="lib/commons-logging-1.2.jar"/>
    <pathelement location="lib/gson-2.8.2.jar"/>
    <pathelement location="lib/guava-23.0.jar"/>
    <pathelement location="lib/hamcrest-core-1.3.jar"/>
    <pathelement location="lib/httpclient-4.5.3.jar"/>
    <pathelement location="lib/httpcore-4.4.6.jar"/>
    <pathelement location="lib/junit-4.12.jar"/>
</path>
<target name="init">
    <mkdir dir="bin"/>
    <copy includeemptydirs="false" todir="bin">
        <fileset dir="src">
            <exclude name="**/*.launch"/>
            <exclude name="**/*.java"/>
        </fileset>
    </copy>
</target>
<target name="clean">
    <delete dir="bin"/>
</target>
<target depends="clean" name="cleanall"/>
<target depends="build-subprojects,build-project,junit" name="build"/>
<target name="build-subprojects"/>
<target depends="init" name="build-project">
    <echo message="${ant.project.name}: ${ant.file}"/>
    <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}">
        <src path="src"/>
        <classpath refid="PROJECTSeleniumTest.classpath"/>
    </javac>
</target>

<target name="create_directory">
    <echo message="Create the directory JenkinsTestReports" />
    <mkdir dir="JenkinsTestReports" />
</target>   

<target name="junit" depends="create_directory">
    <echo message="${java.version}"/>
    <junit printsummary="yes" fork="yes" haltonfailure="yes">
        <classpath>
            <path refid="PROJECTSeleniumTest.classpath" />
            <pathelement location="${basedir}in"/>
        </classpath>
        <batchtest todir="JenkinsTestReports" fork="true">
          <fileset dir="${basedir}in">
            <include name="mainTESTNAME.class"/>
          </fileset>
        </batchtest>
        <formatter type="xml"/>
        <formatter type="plain"/>
    </junit>
</target>

Does anyone know what the cause might be? Thanks.

Question&Answers:os

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

1 Answer

0 votes
by (71.8m points)

This error message...

[30.168][SEVERE]: Timed out receiving message from renderer: 20.000

...implies that the ChromeDriver was unable to initiate a new Chrome browser process.

Your main issue is the version compatibility between the binaries you are using as follows :

  • You are using chromedriver=2.33
  • Release Notes of chromedriver=2.33 clearly mentions the following :

Supports Chrome v60-62

  • You are using chrome=64.0
  • Release Notes of ChromeDriver v2.35 clearly mentions the following :

Supports Chrome v62-64 (includes the browser version you are using)

  • Your Selenium Client version is 3.8.1.
  • Your JDK version is 1.8.0_151 which is pretty older.

So there is a clear mismatch between the JDK v8u151 , Selenium Client v3.8.1 , ChromeDriver v2.33 and Chrome Browser v64.0

Solution

  • Upgrade JDK to recent levels JDK 8u162.
  • Upgrade Selenium to current levels Version 3.11.0.
  • Upgrade ChromeDriver to current ChromeDriver v2.38 level.
  • Keep Chrome version at Chrome v66.x levels. (as per ChromeDriver v2.38 release notes)
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your Test Suite.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Execute your @Test.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...