I have several tests that are automated using selenium/python. Tests are run through teamcity, in xfvb drive where you installed Ubuntu 14.04. all 28 tests, and when they run, I see a process that runs Chrome (using the command ps auvvx | grep chrome | grep -v grep):
but sometimes (it happens on a random test) chrome does not start. does not start - means that chrome processes have started, but the chrome window does not appear on the screen (I'm watching to xvfb via VNCviewer). however, although the chrome processes are started, but they looks quite strange:
please help figure out what the error is? at the moment tests run hangs in 2/3 of cases. on Windows everything works flawlessly.
p.s. I have tried many ways to this problem: play with the parameters of chrome (--no-sandbox, --single-process, --process-per-site, --disable-gpu, etc.); tried write and analyze log of chrome and chromedriver - but the logs are no exceptions or errors.
Chromedriver's log ends with command:
OS:
Ubuntu 14.04
Selenium Version:
3.0.2
ChromeDriver Version: 2.27.440175
Browser:
Google Chrome
Browser Version:
56.0.2924.87 (64-bit)
I have several tests that are automated using selenium/python. Tests are run through teamcity, in xfvb drive where you installed Ubuntu 14.04. all 28 tests, and when they run, I see a process that runs Chrome (using the command ps auvvx | grep chrome | grep -v grep):
`teamcity 31660 2.5 0.0 139000 8368 ? Sl 13:10 0:00 /opt/vendors/chromedriver/webdriver --port=50695 --log-path=chromedriverEnBundlesTests.log
teamcity 31680 27.3 0.2 625396 70948 ? Rl 13:10 0:00 /opt/google/chrome/chrome --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-extensions --disable-gpu --disable-hang-monitor --disable-infobars --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-logging --ignore-certificate-errors --lang=en --load-component-extension=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.EnML8k/internal --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12388 --safebrowsing-disable-auto-update --test-type=webdriver --use-mock-keychain --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.65DCDh --v=1 --verbose --–-single-process data:,
teamcity 31693 1.0 0.0 335680 26132 ? S 13:10 0:00 /opt/google/chrome/chrome --type=zygote --enable-logging --log-level=0 --v=1 --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.65DCDh
teamcity 31696 0.0 0.0 26192 2068 ? S 13:10 0:00 /opt/google/chrome/nacl_helper
teamcity 31699 0.0 0.0 335680 8448 ? S 13:10 0:00 /opt/google/chrome/chrome --type=zygote --enable-logging --log-level=0 --v=1 --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.65DCDh
teamcity 31749 2.5 0.0 706404 31408 ? Sl 13:10 0:00 /opt/google/chrome/chrome --type=renderer --enable-logging --log-level=0 --test-type=webdriver --v=1 --primordial-pipe-token=1DE74651242181EC5B45C60E6057984B --lang=en-US --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.65DCDh --extension-process --disable-client-side-phishing-detection --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --enable-pinch --num-raster-threads=4 --enable-main-frame-before-activation --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553 --disable-accelerated-video-decode --disable-webrtc-hw-encoding --disable-gpu-compositing --service-request-channel-token=1DE74651242181EC5B45C60E6057984B --renderer-client-id=2 --v8-natives-passed-by-fd --v8-snapshot-passed-by-fd
teamcity 31772 14.5 0.1 734440 46176 ? Sl 13:10 0:00 /opt/google/chrome/chrome --type=renderer --enable-logging --log-level=0 --test-type=webdriver --v=1 --primordial-pipe-token=29BAB961D66EB1226D9E5A0151BC00FD --lang=en-US --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.65DCDh --disable-client-side-phishing-detection --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --enable-pinch --num-raster-threads=4 --enable-main-frame-before-activation --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553 --disable-accelerated-video-decode --disable-webrtc-hw-encoding --disable-gpu-compositing --service-request-channel-token=29BAB961D66EB1226D9E5A0151BC00FD --renderer-client-id=4 --v8-natives-passed-by-fd --v8-snapshot-passed-by-fd`
but sometimes (it happens on a random test) chrome does not start. does not start - means that chrome processes have started, but the chrome window does not appear on the screen (I'm watching to xvfb via VNCviewer). however, although the chrome processes are started, but they looks quite strange:
'teamcity 30480 0.0 0.0 135880 7956 ? Sl 09:24 0:00 /opt/vendors/chromedriver/webdriver --port=34227 --log-path=chromedriverBundlesTests.log
teamcity 30485 0.0 0.1 558912 53480 ? Sl 09:24 0:00 /opt/google/chrome/chrome --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-extensions --disable-gpu --disable-hang-monitor --disable-infobars --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-logging --ignore-certificate-errors --lang=en --load-component-extension=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.xt55yX/internal --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12290 --safebrowsing-disable-auto-update --test-type=webdriver --use-mock-keychain --user-agent=CustomUserAgent --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.pFyqzd --v=1 --verbose data:,
teamcity 30496 0.0 0.0 335680 26128 ? S 09:24 0:00 /opt/google/chrome/chrome --type=zygote --enable-logging --log-level=0 --v=1 --user-agent=CustomUserAgent --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.pFyqzd
teamcity 30500 0.0 0.0 26192 2064 ? S 09:24 0:00 /opt/google/chrome/nacl_helper
teamcity 30503 0.0 0.0 335680 8432 ? S 09:24 0:00 /opt/google/chrome/chrome --type=zygote --enable-logging --log-level=0 --v=1 --user-agent=CustomUserAgent --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.pFyqzd
teamcity 30535 0.0 0.0 343876 10328 ? Sl 09:24 0:00 /opt/google/chrome/chrome --type=renderer --enable-logging --log-level=0 --test-type=webdriver --v=1 --primordial-pipe-token=059B5A32F7C1B61E6E6C194E4D3A0DC8 --lang=en-US --user-agent=CustomUserAgent --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.pFyqzd --disable-client-side-phishing-detection --enable-offline-auto-reload --enable-offline-auto-reload-visible-only --enable-pinch --num-raster-threads=4 --enable-main-frame-before-activation --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553 --disable-accelerated-video-decode --disable-webrtc-hw-encoding --disable-gpu-compositing --service-request-channel-token=059B5A32F7C1B61E6E6C194E4D3A0DC8 --renderer-client-id=3 --v8-natives-passed-by-fd --v8-snapshot-passed-by-fd
teamcity 30537 0.2 0.0 558668 14976 ? S 09:24 0:04 /opt/google/chrome/chrome --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-extensions --disable-gpu --disable-hang-monitor --disable-infobars --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-logging --ignore-certificate-errors --lang=en --load-component-extension=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.xt55yX/internal --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12290 --safebrowsing-disable-auto-update --test-type=webdriver --use-mock-keychain --user-agent=CustomUserAgent --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.pFyqzd --v=1 --verbose data:, '
and in this state, the chrome may remain hours or days. below is an example of a test, how I run Chrome from chromedriver:
'def setUp(self): os.environ["CHROME_LOG_FILE"] = 'DeTeasersTests.log' chrome_options = Options() chrome_options.add_argument('--verbose') chrome_options.add_argument('--lang=en') chrome_options.add_argument('--enable-logging') chrome_options.add_argument('--v=1') chrome_options.add_argument('--ignore-certificate-errors') chrome_options.add_argument('--disable-extensions') if platform.system() == 'Linux': service_log_path = "chromedriverDeTeasersTests.log" self.driver = webdriver.Chrome('/opt/vendors/chromedriver/webdriver', chrome_options=chrome_options, service_log_path=service_log_path) elif platform.system() == 'Windows': self.driver = webdriver.Chrome('chromedriver.exe', chrome_options=chrome_options, service_log_path='chromedriver.log') self.base_url = BASE_DE_URL self.driver.get(self.base_url)
def tearDown(self): self.driver.close() time.sleep(5) self.driver.quit()'
please help figure out what the error is? at the moment tests run hangs in 2/3 of cases. on Windows everything works flawlessly. p.s. I have tried many ways to this problem: play with the parameters of chrome (--no-sandbox, --single-process, --process-per-site, --disable-gpu, etc.); tried write and analyze log of chrome and chromedriver - but the logs are no exceptions or errors. Chromedriver's log ends with command:
[1.002][INFO]: Launching chrome: /opt/google/chrome/google-chrome --disable-background-networking --disable-client-side-phishing-detection --disable-default-apps --disable-extensions --disable-hang-monitor --disable-infobars --disable-popup-blocking --disable-prompt-on-repost --disable-sync --disable-web-resources --enable-logging --ignore-certificate-errors --lang=en --load-component-extension=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.viNqJn/internal --log-level=0 --metrics-recording-only --no-first-run --password-store=basic --remote-debugging-port=12458 --safebrowsing-disable-auto-update --test-type=webdriver --use-mock-keychain --user-agent=CustomUserAgent --user-data-dir=/var/tainted/build-agent/temp/buildTmp/.org.chromium.Chromium.i7Q05o --v=1 --verbose data:,
and Chrome debug log is:
[31719:31719:0209/154021.252282:VERBOSE1:breakpad_linux.cc(1852)] Breakpad disabled [1:1:0209/154021.285549:VERBOSE1:zygote_main_linux.cc(619)] ZygoteMain: initializing 2 fork delegates [1:1:0209/154021.285969:VERBOSE1:nacl_fork_delegate_linux.cc(145)] NaClForkDelegate::Init() [1:1:0209/154021.294399:VERBOSE1:nacl_fork_delegate_linux.cc(145)] NaClForkDelegate::Init() [1:1:0209/154021.298540:VERBOSE1:zygote_main_linux.cc(326)] Unable to load plugin internal-not-yet-present internal-not-yet-present: cannot open shared object file: No such file or directory [1:1:0209/154021.298897:INFO:systeminfo.cc(82)] Available number of cores: 8 [31719:31719:0209/154021.357295:VERBOSE1:gpu_info_collector_linux.cc(116)] Failed to locate libpci [31719:31719:0209/154021.367920:VERBOSE1:pulse_stubs.cc(683)] dlopen(libpulse.so.0) failed, dlerror() says: libpulse.so.0: cannot open shared object file: No such file or directory [31719:31719:0209/154021.367968:VERBOSE1:audio_manager_pulse.cc(241)] Failed on loading the Pulse library and symbols [31719:31719:0209/154021.367995:WARNING:audio_manager.cc(317)] Multiple instances of AudioManager detected [31719:31719:0209/154021.368009:WARNING:audio_manager.cc(278)] Multiple instances of AudioManager detected [31719:31719:0209/154021.368918:VERBOSE1:proxy_config_service_linux.cc(1654)] Obtained proxy settings from environment variables [31719:31719:0209/154021.368941:VERBOSE1:pref_proxy_config_tracker_impl.cc(151)] 0x11688b931a80: set chrome proxy config service to 0x11688b80f000 [31719:31719:0209/154021.368975:VERBOSE1:pref_proxy_config_tracker_impl.cc(278)] 0x11688b931a80: Done pushing proxy to UpdateProxyConfig [31719:31719:0209/154021.388340:VERBOSE1:key_storage_linux.cc(49)] OSCrypt store set to basic [31719:31719:0209/154021.394189:VERBOSE1:mutable_profile_oauth2_token_service_delegate.cc(137)] MutablePO2TS::MutablePO2TS [31719:31719:0209/154021.394534:VERBOSE1:bluetooth_low_energy_event_router.cc(248)] Initializing BluetoothLowEnergyEventRouter. [31719:31719:0209/154021.400259:VERBOSE1:proxy_config_service_linux.cc(1654)] Obtained proxy settings from environment variables [31719:31719:0209/154021.400298:VERBOSE1:pref_proxy_config_tracker_impl.cc(151)] 0x11688baec000: set chrome proxy config service to 0x11688bb1e2c0 [31719:31719:0209/154021.400317:VERBOSE1:pref_proxy_config_tracker_impl.cc(278)] 0x11688baec000: Done pushing proxy to UpdateProxyConfig [31719:31719:0209/154021.404894:VERBOSE1:extension_service.cc(1556)] AddComponentExtension Bookmark Manager [31719:31719:0209/154021.404947:VERBOSE1:extension_service.cc(1558)] Component extension Bookmark Manager (eemcgdkfndhakfknompkggombfjjjeno) installing/upgrading from '' to 0.1 [31719:31719:0209/154021.406335:VERBOSE1:extension_service.cc(1556)] AddComponentExtension Cloud Print [31719:31719:0209/154021.406369:VERBOSE1:extension_service.cc(1558)] Component extension Cloud Print (mfehgcgbbipciphmccgaenjidiccnmng) installing/upgrading from '' to 0.1 [31719:31719:0209/154021.407529:VERBOSE1:extension_service.cc(1556)] AddComponentExtension Web Store [31719:31719:0209/154021.407565:VERBOSE1:extension_service.cc(1558)] Component extension Web Store (ahfgeienlihckogmohjhadlkjgocpleb) installing/upgrading from '' to 0.2 [31719:31719:0209/154021.408782:VERBOSE1:extension_service.cc(1556)] AddComponentExtension Chrome PDF Viewer [31719:31719:0209/154021.408816:VERBOSE1:extension_service.cc(1558)] Component extension Chrome PDF Viewer (mhjfbmdgcfjbbpaeojofohoefgiehjai) installing/upgrading from '' to 1 [31719:31719:0209/154021.410047:VERBOSE1:extension_service.cc(1556)] AddComponentExtension Chrome Automation Extension [31719:31719:0209/154021.410081:VERBOSE1:extension_service.cc(1558)] Component extension Chrome Automation Extension (aapnijgdinlhnhlmodcfapnahmbfebeb) installing/upgrading from '' to 1 [31719:31719:0209/154021.416179:VERBOSE1:account_reconcilor.cc(74)] AccountReconcilor::AccountReconcilor [31719:31719:0209/154021.416204:VERBOSE1:account_reconcilor.cc(85)] AccountReconcilor::Initialize [31719:31719:0209/154021.419260:VERBOSE1:ev_whitelist_component_installer.cc(149)] Registering EV whitelist component. [31719:31764:0209/154021.419306:VERBOSE1:default_component_installer.cc(211)] StartRegistration for Adobe Flash Player [31719:31719:0209/154021.419326:VERBOSE1:file_type_policies_component_installer.cc(131)] Registering File Type Policies component. [31719:31719:0209/154021.419515:VERBOSE1:startup_browser_creator_impl.cc(945)] StartupBrowserCreatorImpl::ProcessStartupURLs [31719:31719:0209/154021.419547:VERBOSE1:startup_browser_creator_impl.cc(953)] Pref: default [31719:31764:0209/154021.419614:VERBOSE1:default_component_installer.cc(211)] StartRegistration for EV Certs CT whitelist [31719:31764:0209/154021.419757:VERBOSE1:default_component_installer.cc(211)] StartRegistration for Signed Tree Heads [31719:31764:0209/154021.419901:VERBOSE1:default_component_installer.cc(211)] StartRegistration for Origin Trials [31719:31764:0209/154021.420029:VERBOSE1:default_component_installer.cc(211)] StartRegistration for File Type Policies [31719:31752:0209/154021.433546:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Pilot' log [31719:31752:0209/154021.433576:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Aviator' log [31719:31752:0209/154021.433588:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: DigiCert Log Server [31719:31752:0209/154021.433599:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Rocketeer' log [31719:31752:0209/154021.433609:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Symantec log [31719:31752:0209/154021.433619:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Venafi log [31719:31752:0209/154021.433630:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Symantec 'Vega' log [31719:31752:0209/154021.433640:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: CNNIC CT log [31719:31752:0209/154021.433650:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: WoSign log [31719:31752:0209/154021.433660:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: StartCom CT log [31719:31752:0209/154021.433670:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Skydiver' log [31719:31752:0209/154021.433680:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Icarus' log [31719:31752:0209/154021.433690:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Izenpe log [31719:31752:0209/154021.433700:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Certly.IO log [31719:31752:0209/154021.436338:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Pilot' log [31719:31752:0209/154021.436365:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Aviator' log [31719:31752:0209/154021.436376:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: DigiCert Log Server [31719:31752:0209/154021.436387:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Rocketeer' log [31719:31752:0209/154021.436397:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Symantec log [31719:31752:0209/154021.436408:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Venafi log [31719:31752:0209/154021.436419:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Symantec 'Vega' log [31719:31752:0209/154021.436429:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: CNNIC CT log [31719:31752:0209/154021.436440:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: WoSign log [31719:31752:0209/154021.436450:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: StartCom CT log [31719:31752:0209/154021.436460:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Skydiver' log [31719:31752:0209/154021.436470:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Google 'Icarus' log [31719:31752:0209/154021.436480:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Izenpe log [31719:31752:0209/154021.436490:VERBOSE1:multi_log_ct_verifier.cc(75)] Adding CT log: Certly.IO log