kandi background
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
kandi background
Explore Kits
Explore all UI Testing open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in UI Testing

v1.0.18

v7.0.0

Browser storage handling

v1.6.0

v4.3.1

cypress-realworld-app

v1.0.18

puppeteer-sharp

v7.0.0

phantomas

Browser storage handling

chrome

v1.6.0

cypress-cucumber-preprocessor

v4.3.1

Popular Libraries in UI Testing

Trending New libraries in UI Testing

Top Authors in UI Testing

1

101 Libraries

2814

2

35 Libraries

5764

3

6 Libraries

23

4

6 Libraries

43

5

5 Libraries

61

6

4 Libraries

167

7

4 Libraries

55

8

3 Libraries

7

9

3 Libraries

187

10

3 Libraries

20

1

101 Libraries

2814

2

35 Libraries

5764

3

6 Libraries

23

4

6 Libraries

43

5

5 Libraries

61

6

4 Libraries

167

7

4 Libraries

55

8

3 Libraries

7

9

3 Libraries

187

10

3 Libraries

20

Trending Kits in UI Testing

Trending Discussions on UI Testing

    unknown error: DevToolsActivePort file doesn't exist launching ChromeDriver using robot framework with headless in Docker
    if else case in Android Espresso UI testing
    How to retrieve a random value from an array that has values separate by a new line
    Junit5 Cucumber "No definition found for..." in .feature file
    What is this implemention? Android
    Android: How to perform click action on EditTextPreference using Espresso
    TouchGFX gui automated testing
    Selenium Microsoft Login “Your browser is a bit unusual…” Message
    Returning Conditional Responses from MockedWebService in Swift
    iOS UI Testing cannot see the UILabel

QUESTION

unknown error: DevToolsActivePort file doesn't exist launching ChromeDriver using robot framework with headless in Docker

Asked 2022-Apr-01 at 09:28

I have robot framework which will try to run the UI testing in headless mode. But when we run the robot framework inside Docker container, we got the below error

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Dockerfile:

1FROM python:3.8
2
3ENV JAVA_OPTS "-Dlog4j.formatMsgNoLookups=true"
4ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
5ENV WAIT_VERSION 2.7.2
6
7#Install Google Chrome
8RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
9RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
10RUN set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
11
12#Install Chrome Driver
13RUN BROWSER_MAJOR=$(google-chrome --version | sed 's/Google Chrome \([0-9]*\).*/\1/g') && \
14    wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${BROWSER_MAJOR} -O chrome_version && \
15    wget https://chromedriver.storage.googleapis.com/`cat chrome_version`/chromedriver_linux64.zip && \ 
16    unzip chromedriver_linux64.zip && \
17    mv chromedriver /usr/local/bin/
18
19ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait
20RUN chmod +x /wait
21
22CMD ["/bin/bash"]
23

RobotFramework resource details

1FROM python:3.8
2
3ENV JAVA_OPTS "-Dlog4j.formatMsgNoLookups=true"
4ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
5ENV WAIT_VERSION 2.7.2
6
7#Install Google Chrome
8RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
9RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
10RUN set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
11
12#Install Chrome Driver
13RUN BROWSER_MAJOR=$(google-chrome --version | sed 's/Google Chrome \([0-9]*\).*/\1/g') && \
14    wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${BROWSER_MAJOR} -O chrome_version && \
15    wget https://chromedriver.storage.googleapis.com/`cat chrome_version`/chromedriver_linux64.zip && \ 
16    unzip chromedriver_linux64.zip && \
17    mv chromedriver /usr/local/bin/
18
19ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait
20RUN chmod +x /wait
21
22CMD ["/bin/bash"]
23##### Headless Browser ##########
24    ###### For Headless #######
25    ${chrome options} =     Evaluate    selenium.webdriver.ChromeOptions()
26    ...                     modules=selenium, selenium.webdriver
27    Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
28    Call Method    ${chrome_options}   add_argument    headless
29    Call Method    ${chrome_options}   add_argument    disable-gpu
30    Call Method    ${chrome_options}   add_argument    --ignore-certificate-errors
31    ${var}=     Call Method     ${chrome_options}    to_capabilities 
32    Create Webdriver   driver_name=Chrome   alias=google   chrome_options=${chrome_options}     
33    Go To   ${environment.url}
34    Maximize Browser Window 
35

How to fix this issue?

ANSWER

Answered 2022-Apr-01 at 09:16

To get across the error:

copy icondownload icon

1FROM python:3.8
2
3ENV JAVA_OPTS "-Dlog4j.formatMsgNoLookups=true"
4ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
5ENV WAIT_VERSION 2.7.2
6
7#Install Google Chrome
8RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
9RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
10RUN set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
11
12#Install Chrome Driver
13RUN BROWSER_MAJOR=$(google-chrome --version | sed 's/Google Chrome \([0-9]*\).*/\1/g') && \
14    wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${BROWSER_MAJOR} -O chrome_version && \
15    wget https://chromedriver.storage.googleapis.com/`cat chrome_version`/chromedriver_linux64.zip && \ 
16    unzip chromedriver_linux64.zip && \
17    mv chromedriver /usr/local/bin/
18
19ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait
20RUN chmod +x /wait
21
22CMD ["/bin/bash"]
23##### Headless Browser ##########
24    ###### For Headless #######
25    ${chrome options} =     Evaluate    selenium.webdriver.ChromeOptions()
26    ...                     modules=selenium, selenium.webdriver
27    Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
28    Call Method    ${chrome_options}   add_argument    headless
29    Call Method    ${chrome_options}   add_argument    disable-gpu
30    Call Method    ${chrome_options}   add_argument    --ignore-certificate-errors
31    ${var}=     Call Method     ${chrome_options}    to_capabilities 
32    Create Webdriver   driver_name=Chrome   alias=google   chrome_options=${chrome_options}     
33    Go To   ${environment.url}
34    Maximize Browser Window 
35WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. 
36  (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
37

you can add the argument --no-sandbox as follows:

copy icondownload icon

1FROM python:3.8
2
3ENV JAVA_OPTS "-Dlog4j.formatMsgNoLookups=true"
4ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
5ENV WAIT_VERSION 2.7.2
6
7#Install Google Chrome
8RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
9RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
10RUN set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
11
12#Install Chrome Driver
13RUN BROWSER_MAJOR=$(google-chrome --version | sed 's/Google Chrome \([0-9]*\).*/\1/g') && \
14    wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${BROWSER_MAJOR} -O chrome_version && \
15    wget https://chromedriver.storage.googleapis.com/`cat chrome_version`/chromedriver_linux64.zip && \ 
16    unzip chromedriver_linux64.zip && \
17    mv chromedriver /usr/local/bin/
18
19ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait
20RUN chmod +x /wait
21
22CMD ["/bin/bash"]
23##### Headless Browser ##########
24    ###### For Headless #######
25    ${chrome options} =     Evaluate    selenium.webdriver.ChromeOptions()
26    ...                     modules=selenium, selenium.webdriver
27    Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
28    Call Method    ${chrome_options}   add_argument    headless
29    Call Method    ${chrome_options}   add_argument    disable-gpu
30    Call Method    ${chrome_options}   add_argument    --ignore-certificate-errors
31    ${var}=     Call Method     ${chrome_options}    to_capabilities 
32    Create Webdriver   driver_name=Chrome   alias=google   chrome_options=${chrome_options}     
33    Go To   ${environment.url}
34    Maximize Browser Window 
35WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. 
36  (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
37##### Headless Browser ##########
38    ###### For Headless #######
39    ${chrome options} =     Evaluate    selenium.webdriver.ChromeOptions()
40    ...                     modules=selenium, selenium.webdriver
41    Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
42    Call Method    ${chrome_options}   add_argument    headless
43    Call Method    ${chrome_options}   add_argument    --no-sandbox   # newly added argument
44    Call Method    ${chrome_options}   add_argument    disable-gpu
45    Call Method    ${chrome_options}   add_argument    --ignore-certificate-errors
46    ${var}=     Call Method     ${chrome_options}    to_capabilities 
47    Create Webdriver   driver_name=Chrome   alias=google   chrome_options=${chrome_options}     
48    Go To   ${environment.url}
49    Maximize Browser Window 
50

Source https://stackoverflow.com/questions/71704028

Community Discussions contain sources that include Stack Exchange Network

    unknown error: DevToolsActivePort file doesn't exist launching ChromeDriver using robot framework with headless in Docker
    if else case in Android Espresso UI testing
    How to retrieve a random value from an array that has values separate by a new line
    Junit5 Cucumber "No definition found for..." in .feature file
    What is this implemention? Android
    Android: How to perform click action on EditTextPreference using Espresso
    TouchGFX gui automated testing
    Selenium Microsoft Login “Your browser is a bit unusual…” Message
    Returning Conditional Responses from MockedWebService in Swift
    iOS UI Testing cannot see the UILabel

QUESTION

unknown error: DevToolsActivePort file doesn't exist launching ChromeDriver using robot framework with headless in Docker

Asked 2022-Apr-01 at 09:28

I have robot framework which will try to run the UI testing in headless mode. But when we run the robot framework inside Docker container, we got the below error

WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)

Dockerfile:

1FROM python:3.8
2
3ENV JAVA_OPTS "-Dlog4j.formatMsgNoLookups=true"
4ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
5ENV WAIT_VERSION 2.7.2
6
7#Install Google Chrome
8RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
9RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
10RUN set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
11
12#Install Chrome Driver
13RUN BROWSER_MAJOR=$(google-chrome --version | sed 's/Google Chrome \([0-9]*\).*/\1/g') && \
14    wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${BROWSER_MAJOR} -O chrome_version && \
15    wget https://chromedriver.storage.googleapis.com/`cat chrome_version`/chromedriver_linux64.zip && \ 
16    unzip chromedriver_linux64.zip && \
17    mv chromedriver /usr/local/bin/
18
19ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait
20RUN chmod +x /wait
21
22CMD ["/bin/bash"]
23

RobotFramework resource details

1FROM python:3.8
2
3ENV JAVA_OPTS "-Dlog4j.formatMsgNoLookups=true"
4ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
5ENV WAIT_VERSION 2.7.2
6
7#Install Google Chrome
8RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
9RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
10RUN set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
11
12#Install Chrome Driver
13RUN BROWSER_MAJOR=$(google-chrome --version | sed 's/Google Chrome \([0-9]*\).*/\1/g') && \
14    wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${BROWSER_MAJOR} -O chrome_version && \
15    wget https://chromedriver.storage.googleapis.com/`cat chrome_version`/chromedriver_linux64.zip && \ 
16    unzip chromedriver_linux64.zip && \
17    mv chromedriver /usr/local/bin/
18
19ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait
20RUN chmod +x /wait
21
22CMD ["/bin/bash"]
23##### Headless Browser ##########
24    ###### For Headless #######
25    ${chrome options} =     Evaluate    selenium.webdriver.ChromeOptions()
26    ...                     modules=selenium, selenium.webdriver
27    Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
28    Call Method    ${chrome_options}   add_argument    headless
29    Call Method    ${chrome_options}   add_argument    disable-gpu
30    Call Method    ${chrome_options}   add_argument    --ignore-certificate-errors
31    ${var}=     Call Method     ${chrome_options}    to_capabilities 
32    Create Webdriver   driver_name=Chrome   alias=google   chrome_options=${chrome_options}     
33    Go To   ${environment.url}
34    Maximize Browser Window 
35

How to fix this issue?

ANSWER

Answered 2022-Apr-01 at 09:16

To get across the error:

copy icondownload icon

1FROM python:3.8
2
3ENV JAVA_OPTS "-Dlog4j.formatMsgNoLookups=true"
4ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
5ENV WAIT_VERSION 2.7.2
6
7#Install Google Chrome
8RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
9RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
10RUN set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
11
12#Install Chrome Driver
13RUN BROWSER_MAJOR=$(google-chrome --version | sed 's/Google Chrome \([0-9]*\).*/\1/g') && \
14    wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${BROWSER_MAJOR} -O chrome_version && \
15    wget https://chromedriver.storage.googleapis.com/`cat chrome_version`/chromedriver_linux64.zip && \ 
16    unzip chromedriver_linux64.zip && \
17    mv chromedriver /usr/local/bin/
18
19ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait
20RUN chmod +x /wait
21
22CMD ["/bin/bash"]
23##### Headless Browser ##########
24    ###### For Headless #######
25    ${chrome options} =     Evaluate    selenium.webdriver.ChromeOptions()
26    ...                     modules=selenium, selenium.webdriver
27    Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
28    Call Method    ${chrome_options}   add_argument    headless
29    Call Method    ${chrome_options}   add_argument    disable-gpu
30    Call Method    ${chrome_options}   add_argument    --ignore-certificate-errors
31    ${var}=     Call Method     ${chrome_options}    to_capabilities 
32    Create Webdriver   driver_name=Chrome   alias=google   chrome_options=${chrome_options}     
33    Go To   ${environment.url}
34    Maximize Browser Window 
35WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. 
36  (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
37

you can add the argument --no-sandbox as follows:

copy icondownload icon

1FROM python:3.8
2
3ENV JAVA_OPTS "-Dlog4j.formatMsgNoLookups=true"
4ENV LOG4J_FORMAT_MSG_NO_LOOKUPS=true
5ENV WAIT_VERSION 2.7.2
6
7#Install Google Chrome
8RUN echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' > /etc/apt/sources.list.d/chrome.list
9RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
10RUN set -x && apt-get update && apt-get install -y xvfb google-chrome-stable
11
12#Install Chrome Driver
13RUN BROWSER_MAJOR=$(google-chrome --version | sed 's/Google Chrome \([0-9]*\).*/\1/g') && \
14    wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${BROWSER_MAJOR} -O chrome_version && \
15    wget https://chromedriver.storage.googleapis.com/`cat chrome_version`/chromedriver_linux64.zip && \ 
16    unzip chromedriver_linux64.zip && \
17    mv chromedriver /usr/local/bin/
18
19ADD https://github.com/ufoscout/docker-compose-wait/releases/download/$WAIT_VERSION/wait /wait
20RUN chmod +x /wait
21
22CMD ["/bin/bash"]
23##### Headless Browser ##########
24    ###### For Headless #######
25    ${chrome options} =     Evaluate    selenium.webdriver.ChromeOptions()
26    ...                     modules=selenium, selenium.webdriver
27    Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
28    Call Method    ${chrome_options}   add_argument    headless
29    Call Method    ${chrome_options}   add_argument    disable-gpu
30    Call Method    ${chrome_options}   add_argument    --ignore-certificate-errors
31    ${var}=     Call Method     ${chrome_options}    to_capabilities 
32    Create Webdriver   driver_name=Chrome   alias=google   chrome_options=${chrome_options}     
33    Go To   ${environment.url}
34    Maximize Browser Window 
35WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally. 
36  (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
37##### Headless Browser ##########
38    ###### For Headless #######
39    ${chrome options} =     Evaluate    selenium.webdriver.ChromeOptions()
40    ...                     modules=selenium, selenium.webdriver
41    Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
42    Call Method    ${chrome_options}   add_argument    headless
43    Call Method    ${chrome_options}   add_argument    --no-sandbox   # newly added argument
44    Call Method    ${chrome_options}   add_argument    disable-gpu
45    Call Method    ${chrome_options}   add_argument    --ignore-certificate-errors
46    ${var}=     Call Method     ${chrome_options}    to_capabilities 
47    Create Webdriver   driver_name=Chrome   alias=google   chrome_options=${chrome_options}     
48    Go To   ${environment.url}
49    Maximize Browser Window 
50

Source https://stackoverflow.com/questions/71704028