Unable to Create Driver Instance for chrome in ubuntu

2,425 views
Skip to first unread message

MK Patil

unread,
Apr 11, 2018, 12:35:10 AM4/11/18
to qaf users

Steps To Reproduce

using following configurations
1. ChromeDriver 2.36.540471
2. qaf 2.1.13
3. java 1.8

Expected behavior

I am able to run UI test suites in mac , however not able to run on ubuntu/debian linux systems.


Getting the following exception after running mvn test

[QAFTestBase] - Initializing Driver...browser_str:chromeDriver,base_url:https://platform-dev-test.celectengine.com:30410,sel_server:localhost,port:4444

[UiDriverFactory] - Driver: chromeDriver

Starting ChromeDriver 2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752) on port 23154

Only local connections are allowed.

Starting ChromeDriver 2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752) on port 9515

Only local connections are allowed.

Invalid --log-level value.

Unable to initialize logging. Exiting...

Unable to create driver instance in 1st attempt with retry timeout of 0 seconds. You can check/set value of 'driver.init.retry.timeout' appropriately to set retry timeout on driver initialization failure.Unable to Create Driver Instance for chrome: unknown error: Chrome failed to start: exited abnormally

  (Driver info: chromedriver=2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752),platform=Linux 4.4.0-1052-aws x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 60.09 seconds

Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'

System info: host: 'ip-172-31-22-12', ip: '172.31.22.12', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-1052-aws', java.version: '1.8.0_162'



application.properties details:

env.baseurl=https://applicationhostname:port

env.resources=resources

resources.load.subdirs=1


#set appropriate teststep provider package

step.provider.pkg=com.qmetry.qaf.example


#[selenium]

remote.server=localhost

remote.port=4444

#you can override this property from config file by providing "browser" parameter

driver.name=chromeDriver

#webdriver.remote.session=fd313470-4e25-4122-9009-5db2ae04c98d

selenium.wait.timeout=60000

#webdriver.ie.driver=F:/Downloads/selenium/IEDriverServer_Win32_2.22.0/IEDriverServer.exe

#webdriver.chrome.driver=F:/Downloads/selenium/chromedriver.exe

#selenium.screenshot.dir=test-results/img/

#selenium.report.dir=test-results/html/


#switch capturing screenshots on/off on checkpoint success 

selenium.success.screenshots=1


#wd.command.listeners=

#we.command.listeners=

#teststep.listeners=


retry.count=0


#set true to fill bean randomly from set of testdata

#bean.populate.random=false


#set 1 to suppress success log, when 0 it will also show verification success message

report.log.skip.success=0

webdriver.chrome.driver = /home/ubuntu/software/chromedriver


chrome.additional.capabilities={"chromeOptions":{"args":["--headless"], "binary": "/home/ubuntu/software/chromedriver"}}


cjayswal

unread,
Apr 11, 2018, 5:08:06 PM4/11/18
to qaf users
You are using arg --headless so with that my be you can try with another argument --no-sandbox and window-size=1024,768.


chrome.additional.capabilities={"chromeOptions":{"args":["--headless", "window-size=1024,768", "--no-sandbox"], "binary": "/home/ubuntu/software/chromedriver"}}


You can refer following

https://stackoverflow.com/questions/22558077/unknown-error-chrome-failed-to-start-exited-abnormally-driver-info-chromedri
https://github.com/SeleniumHQ/selenium/issues/4961


मंगलवार, 10 अप्रैल 2018 को 9:35:10 अपर UTC-7 को, MK Patil ने लिखा:

M.K.Patil

unread,
Apr 11, 2018, 9:11:29 PM4/11/18
to cjayswal, qaf users
Thanks for the reply. I made changes as you suggested, now the timeout issue has gone, however i am getting below issue. Can you help here please?

[UiDriverFactory] - Driver: chromeDriver

Starting ChromeDriver 2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752) on port 22567

Only local connections are allowed.

Starting ChromeDriver 2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752) on port 9515

Only local connections are allowed.

Invalid --log-level value.

Unable to initialize logging. Exiting...

Unable to create driver instance in 1st attempt with retry timeout of 0 seconds. You can check/set value of 'driver.init.retry.timeout' appropriately to set retry timeout on driver initialization failure.Unable to Create Driver Instance for chrome: unknown error: Chrome failed to start: exited abnormally

  (Driver info: chromedriver=2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752),platform=Linux 4.4.0-1052-aws x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 60.14 seconds

Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'


--
You received this message because you are subscribed to the Google Groups "qaf users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qaf-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qaf-users/f99d8446-1423-46b6-8881-c750af6004e5%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
M.K.PATIL

cjayswal

unread,
Apr 11, 2018, 10:26:00 PM4/11/18
to qaf-...@googlegroups.com
I can still see "unknown error: Chrome failed to start: exited abnormally" in stack-trace. Once again it's more related to driver rather than framework. Will you try by updating selenium version in dependencies?

M.K.Patil

unread,
Apr 12, 2018, 1:26:15 AM4/12/18
to cjayswal, qaf users
added selenium version and issue has been disappeared, however i am getting the below exception.

Exception: 

Failed tests:   executeMovielLensTest(com.celect.pdb.testcases.test.MovieLensTest): org.openqa.selenium.support.ui.FluentWait.withMessage(Lcom/google/common/base/Supplier;)Lorg/openqa/selenium/support/ui/FluentWait;




pom.xml has following details:

<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"

         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>


    <groupId>com.celect.pdb</groupId>

    <artifactId>ui-automation</artifactId>

    <version>1.0.0-SNAPSHOT</version>

    <packaging>jar</packaging>


    <name>celect-pdb-ui-automation</name>

    <url>http://maven.apache.org</url>


    <properties>

        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

        <testSuiteFile>config/testrun_config.xml</testSuiteFile>

        <sourceVersion>1.8</sourceVersion>

        <targetVersion>1.8</targetVersion>

        <qaf.version>2.1.13</qaf.version>

        <test.results.dir>test-results</test.results.dir>

        <run.time>${maven.build.timestamp}</run.time>

        <lib.dir>${project.basedir}/lib</lib.dir>

        <resource.dir>${project.basedir}/resources</resource.dir>

        <output.dir>${test.results.dir}/${run.time}</output.dir>

        <maven.build.timestamp.format>dd_MMM_yyyy_hh_mm_aa</maven.build.timestamp.format>

        <testng.report.title>Celect pDB UI Automation</testng.report.title>

    </properties>

    <repositories>

        <repository>

            <id>qaf</id>

            <url>https://qmetry.github.io/qaf/dist</url>

        </repository>

        <repository>

            <id>jai</id>

            <url>https://repository.jboss.org/nexus/content/repositories/thirdparty-releases</url>

        </repository>

        <repository>

            <id>qmetrytestmanager-mvn-repo</id>

            <name>QMetry Test Manager Maven Repository</name>

            <url>https://raw.github.com/qmetry/qtm4j-maven-uploader/mvn-repo/</url>

        </repository>

    </repositories>





    <dependencies>

   

  <dependency>

        <groupId>com.google.guava</groupId>

        <artifactId>guava</artifactId>

        <version>23.0</version>

      </dependency>


 

<dependency>

    <groupId>org.seleniumhq.selenium</groupId>

    <artifactId>selenium-support</artifactId>

    <version>3.0.0</version>

</dependency>

<dependency>

    <groupId>org.seleniumhq.selenium</groupId>

    <artifactId>selenium-java</artifactId>

    <version>3.4.0</version>

</dependency>


<dependency>

    <groupId>org.seleniumhq.selenium</groupId>

    <artifactId>selenium-remote-driver</artifactId>

    <version>3.4.0</version>

</dependency>




    <dependency>

            <groupId>com.qmetry</groupId>

            <artifactId>qaf</artifactId>

            <version>${qaf.version}</version>

        </dependency>

        <dependency>

            <groupId>com.qmetry</groupId>

            <artifactId>qaf-support</artifactId>

            <version>${qaf.version}</version>

        </dependency>

        <dependency>

            <groupId>com.qmetry</groupId>

            <artifactId>automation</artifactId>

            <version>1.0.0</version>

        </dependency>

    </dependencies>

    <build>


        <plugins>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-compiler-plugin</artifactId>

                <configuration>

                    <compilerVersion>${sourceVersion}</compilerVersion>

                    <source>1.8</source>

                    <target>1.8</target>

                </configuration>

            </plugin>

            <plugin>

                <groupId>org.codehaus.mojo</groupId>

                <artifactId>aspectj-maven-plugin</artifactId>

                <version>1.7</version>

                <executions>

                    <execution>

                        <id>test-compile</id>

                        <goals>

                            <goal>test-compile</goal>

                        </goals>

                    </execution>

                </executions>

                <configuration>

                    <source>${sourceVersion}</source>

                    <target>${targetVersion}</target>

                    <showWeaveInfo>true</showWeaveInfo>

                    <complianceLevel>${sourceVersion}</complianceLevel>

                    <aspectLibraries>

                        <aspectLibrary>

                            <groupId>com.qmetry</groupId>

                            <artifactId>qaf</artifactId>

                        </aspectLibrary>

                    </aspectLibraries>

                </configuration>

            </plugin>

            <plugin>

                <groupId>org.apache.maven.plugins</groupId>

                <artifactId>maven-surefire-plugin</artifactId>

                <version>2.9</version>

                <configuration>

                    <properties>

                        <property>

                            <name>listener</name>

                            <value>com.qmetry.automation.QASResultUploader</value>

                        </property>

                    </properties>

                    <suiteXmlFiles>

                        <suiteXmlFile>${testSuiteFile}</suiteXmlFile>

                    </suiteXmlFiles>

                    <reportsDirectory>${test.results.dir}/${run.time}</reportsDirectory>

                    <systemPropertyVariables>

                        <org.uncommons.reportng.xml-dialect>testng</org.uncommons.reportng.xml-dialect>

                        <org.uncommons.reportng.escape-output>false</org.uncommons.reportng.escape-output>

                        <log4j.configuration>file:///${resource.dir}/log4j.properties</log4j.configuration>

                        <outputDir>${output.dir}</outputDir>

                        <test.results.dir>${output.dir}/html</test.results.dir>

                        <json.report.root.dir>${test.results.dir}</json.report.root.dir>

                        <json.report.dir>${output.dir}/json</json.report.dir>

                        <selenium.screenshots.dir>${output.dir}/img</selenium.screenshots.dir>

                        <selenium.screenshots.relative.path>../img</selenium.screenshots.relative.path>

                    </systemPropertyVariables>

                </configuration>

            </plugin>

        </plugins>

        <pluginManagement>

            <plugins>

                <plugin>

                    <groupId>org.eclipse.m2e</groupId>

                    <artifactId>lifecycle-mapping</artifactId>

                    <version>1.0.0</version>

                    <configuration>

                        <lifecycleMappingMetadata>

                            <pluginExecutions>

                                <pluginExecution>

                                    <pluginExecutionFilter>

                                        <groupId>org.codehaus.mojo</groupId>

                                        <artifactId>aspectj-maven-plugin</artifactId>

                                        <versionRange>[1.0,)</versionRange>

                                        <goals>

                                            <goal>test-compile</goal>

                                            <goal>compile</goal>

                                        </goals>

                                    </pluginExecutionFilter>

                                    <action>

                                        <execute/>

                                    </action>

                                </pluginExecution>

                            </pluginExecutions>

                        </lifecycleMappingMetadata>

                    </configuration>

                </plugin>

            </plugins>

        </pluginManagement>

    </build>

</project>


 



On Thu, Apr 12, 2018 at 7:56 AM, cjayswal <cjay...@gmail.com> wrote:
I can still see "unknown error: Chrome failed to start: exited abnormally" in stack-trace. Will you check by updating selenium version in dependencies?

--
You received this message because you are subscribed to the Google Groups "qaf users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qaf-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
M.K.PATIL

HiroMT

unread,
Apr 12, 2018, 10:23:07 AM4/12/18
to qaf users
I had the similar kind of problem, Can you try including dependency? This solved the  org.openqa.selenium.support.ui.FluentWait.withMessage for me

<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-support</artifactId>
<version>3.0.0</version>
</dependency>


To unsubscribe from this group and stop receiving emails from it, send an email to qaf-users+...@googlegroups.com.



--
M.K.PATIL

M.K.Patil

unread,
Apr 13, 2018, 12:01:21 AM4/13/18
to HiroMT, qaf users
following dependencies have been already added without much luck.

 <dependency>

        <groupId>com.google.guava</groupId>

        <artifactId>guava</artifactId>

        <version>23.0</version>

      </dependency>


 

<dependency>

    <groupId>org.seleniumhq.selenium</groupId>

    <artifactId>selenium-support</artifactId>

    <version>3.0.0</version>

</dependency>

<dependency>

    <groupId>org.seleniumhq.selenium</groupId>

    <artifactId>selenium-java</artifactId>

    <version>3.4.0</version>

</dependency>


<dependency>

    <groupId>org.seleniumhq.selenium</groupId>

    <artifactId>selenium-remote-driver</artifactId>

    <version>3.4.0</version>

</dependency>



To unsubscribe from this group and stop receiving emails from it, send an email to qaf-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qaf-users/deb2037b-8936-4bbc-8109-239c6a9afe8f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
M.K.PATIL

cjayswal

unread,
Apr 15, 2018, 3:29:14 PM4/15/18
to qaf users
This is all because of third party dependencies. with QAF Release 2.1.14-RC1 qaf is not using any class from selenium support so it should work fine without selenium support. Try updating qaf version to 2.1.14 and removing support and other dependency which you are not using in your project.

गुरुवार, 12 अप्रैल 2018 को 9:01:21 अपर UTC-7 को, MK Patil ने लिखा:

M.K.Patil

unread,
Apr 16, 2018, 12:09:45 AM4/16/18
to cjayswal, qaf users
Thanks, I used 2.1.14-RC1 without much luck . pom.xml entries are as follows.

  <dependency>

            <groupId>com.qmetry</groupId>

            <artifactId>qaf</artifactId>

            <version>2.1.14-RC1</version>

        </dependency>

        <dependency>

            <groupId>com.qmetry</groupId>

            <artifactId>qaf-support</artifactId>

            <version>2.1.13</version>

        </dependency>

        <dependency>

            <groupId>com.qmetry</groupId>

            <artifactId>automation</artifactId>

            <version>1.0.0</version>

        </dependency>


Exception details:

[QAFTestBase] - Initializing Driver...browser_str:chromeDriver,base_url:https://platform-dev-test.celectengine.com:30410,sel_server:localhost,port:4444

[UiDriverFactory] - Driver: chromeDriver

Starting ChromeDriver 2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752) on port 13135

Only local connections are allowed.

Starting ChromeDriver 2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752) on port 9515

Only local connections are allowed.

Invalid --log-level value.

Unable to initialize logging. Exiting...


Unable to create driver instance in 1st attempt with retry timeout of 0 seconds. You can check/set value of 'driver.init.retry.timeout' appropriately to set retry timeout on driver initialization failure.Unable to Create Driver Instance for chrome: unknown error: Chrome failed to start: exited abnormally

  (Driver info: chromedriver=2.36.540471 (9c759b81a907e70363c6312294d30b6ccccc2752),platform=Linux 4.4.0-1052-aws x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 60.09 seconds

Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'

System info: host: 'ip-172-31-23-52', ip: '172.31.23.52', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-1052-aws', java.version: '1.8.0_162'

Driver info: com.qmetry.qaf.automation.ui.webdriver.QAFExtendedWebDriver

[QMETRY] [AUTOMATION] :- ********** qmetry.properties file loading Started. **********

[QMETRY] [AUTOMATION] :- qmetry.properties file not found

[QMETRY] [AUTOMATION] :- qmetry.properties file not loaded proper

[QMETRY] [AUTOMATION] :- ********** qmetry.properties file loading Failed. **********

Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 61.041 sec <<< FAILURE!

[ChromeDriverHelper] - Stopping chrome driver service.


Results :


Failed tests:   executeMovielLensTest(com.celect.pdb.testcases.test.MovieLensTest): Timed out after 0 seconds: Unable to create driver instance in 1st attempt with retry timeout of 0 seconds. You can check/set value of 'driver.init.retry.timeout' appropriately to set retry timeout on driver initialization failure.


Tests run: 1, Failures: 1, Errors: 0, Skipped: 0




For more options, visit https://groups.google.com/d/optout.



--
M.K.PATIL
Reply all
Reply to author
Forward
0 new messages