Python driver.get() on a url makes long time

627 views
Skip to first unread message

Jacques Levy (jacqlevy)

unread,
Apr 12, 2017, 9:59:51 AM4/12/17
to chromi...@chromium.org, Dirk Pranke (dpranke@chromium.org)

 

Hi,

 

We are using chromium as default browser for set-top-box.

We do some tests through python and webdriver , on remote host (not on set-to-box).

Previously (chromium version 53) it was working correctly.

We have recently rebased to chromium version 55.

It seems we have some issues since last update.

 

driver.get()on a url  makes very long time .

Do you know if there are issues/incompatibilities with this chromium version and  python webdriver.

 

 

Here are the versions we use:

chromedriver=2.24.417424, platform=Linux 3.13.0-109-generic x86_64

_____________________________________ test_https_url_without_certificates ______________________________________

test_IWECertificates_new.py:179: in test_https_url_without_certificates

    driver.get('https://www.google.com/')

../../venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:261: in get

    self.execute(Command.GET, {'url': url})

../../venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:249: in execute

    self.error_handler.check_response(response)

../../venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py:193: in check_response

    raise exception_class(message, screen, stacktrace)

E   TimeoutException: Message: timeout: Timed out receiving message from renderer: -302.272

E     (Session info: content shell=)

E     (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.13.0-109-generic x86_64)

 

 

Thanks

 

Regards

 

Failure is the following :

        logs = conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && dbus-send '+conftest.DBUS_TYPE+' --type=method_call --print-reply  --dest='+conftest.get_browser_name()+' '+conftest.get_browser_path_name()+' '+conftest.get_browser_name()+'.WebView.start string:\''+get_current_view()+'\' string:\''+get_current_url()+'\'',mytimeout=conftest.LONG_TIMEOUT)

        if (conftest.myConnection.isError()==True):

            logger.error( logs)

            assert False  

        logger.debug("IWE Browser ready")  

        driver = conftest.getChromeDriver()

        # Chromedriver connection

        logger.debug("Chromedriver connected")

   

        '''set_time_to_wait("10")

        logs = conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && sleep '+get_time_to_wait()+'',mytimeout=conftest.LONG_TIMEOUT)'''

   

        ### Go to https url

        logger.debug("Going to https://www.google.com & wait a little")

>       driver.get('https://www.google.com/')

 

test/common/test_IWECertificates_new.py:179:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:261: in get

    self.execute(Command.GET, {'url': url})

.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:249: in execute

    self.error_handler.check_response(response)

 

 

 

FAIL test_IWECertificates_new.py::test_https_url_without_certificates

=================================================== FAILURES ===================================================

PhistucK

unread,
Apr 12, 2017, 10:14:56 AM4/12/17
to jacq...@cisco.com, chromi...@chromium.org, Dirk Pranke (dpranke@chromium.org)
I think you better post this to chromedriver-users, or file an issue at crbug.com/chromedriver (if you could not find one).


PhistucK

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/436c9c6b89d440d9bc5f57c809a0b478%40XCH-RTP-013.cisco.com.

Jacques Levy (jacqlevy)

unread,
Apr 12, 2017, 11:01:05 AM4/12/17
to PhistucK, chromi...@chromium.org, Dirk Pranke (dpranke@chromium.org)

Hi,

 

Thanks for your answer.

 

What i can say more precisely is that the problem seems linked to certificates.

 

I mean:

 

·       If certificates are at the good area (which is the default), and I ask to change the url using python webdriver, it correctly works.

py.test --tb=short -s -rfx test_IWECertificates_new.py::test_https_url_with_certificates --junitxml=result.xml --html=result.html

 

 

              ------------- generated xml file: /local2/ljlevy/testNg/infinite-webengine/test/common/result.xml --------------

              ========================================== 1 passed in 102.14 seconds ==========================================

 

·       If I do the same after having removed the certificates (tests expect to have an error) , there is a time latency (long more than 2 minutes)

 

             py.test --tb=short -s -rfx test_IWECertificates_new.py::test_https_url_without_certificates --junitxml=result.xml --html=result.html

 

 

    ================================================== FAILURES ===================================================

    _____________________________________ test_https_url_without_certificates ______________________________________

    test_IWECertificates_new.py:179: in test_https_url_without_certificates

      driver.get('https://www.google.com/')

   ../../venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:261: in get

      self.execute(Command.GET, {'url': url})

   ../../venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:249: in execute

      self.error_handler.check_response(response)

  ../../venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py:193: in check_response

    raise exception_class(message, screen, stacktrace)

  E   TimeoutException: Message: timeout: Timed out receiving message from renderer: 300.000

  E     (Session info: content shell=)

  E     (Driver info: chromedriver=2.24.417424 (c5c5ea873213ee72e3d0929b47482681555340c3),platform=Linux 3.13.0-109-generic x86_64)

  ========================================== 1

 

The behavior I was expected to have is to have an error when the certificated are not present , but not to get in timeout.

(This was the previous behavior of chromium version)

 

I give you some part of code:

 

 

 

 

 

def test_https_url_without_certificates(request,set_vars,prepare_test_environment,setup_certificates_env):

 

    ## Connect webdriver and start a view

    assert(conftest.myConnection.isConnected())

 

    # #############################

    # First part: No certificates

    # ##############################

 

    # Create an empty root certificate directory

    logs = conftest.myConnection.runCommand(cmd='mkdir -p /opt/empty_dir',mytimeout=conftest.SHORT_TIMEOUT)

    if (conftest.myConnection.isError()==True):

        logger.error( logs)

        assert False

 

    # Mount bind an empty root certificate directory

    logs = conftest.myConnection.runCommand(cmd='mount --bind /opt/empty_dir /etc/ssl/certs',mytimeout=conftest.SHORT_TIMEOUT)

    print logs

    if (conftest.myConnection.isError()==True):

        logger.error( logs)

        assert False

 

    # Check certificates are no present

    logs =  conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && ls /etc/ssl/certs/*.pem',mytimeout=conftest.LONG_TIMEOUT)

   if (conftest.myConnection.isError()==False):

        logger.error( logs)

        assert False

 

    output = ''.join(map(str, logs.encode('utf-8')))

    assert 'Root_CA' not in output

 

# Restart webengine

    conftest.restart_webengine(request)

 

    # Create the initial webview for chromedriver

    logs =  conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && dbus-send '+conftest.DBUS_TYPE+' --type=method_call --print-reply --dest='+conftest.get_browser_name()+' '+conftest.get_browser_path_name()+' '+conftest.get_browser_name()+'.WebView.create string:\''+get_current_view()+'\'',mytimeout=conftest.LONG_TIMEOUT)

    if (conftest.myConnection.isError()==True):

        logger.error( logs)

        assert False

 

    logs = conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && dbus-send '+conftest.DBUS_TYPE+' --type=method_call --print-reply  --dest='+conftest.get_browser_name()+' '+conftest.get_browser_path_name()+' '+conftest.get_browser_name()+'.WebView.start string:\''+get_current_view()+'\' string:\''+get_current_url()+'\'',mytimeout=conftest.LONG_TIMEOUT)

    if (conftest.myConnection.isError()==True):

        logger.error( logs)

        assert False

 

    logger.debug("IWE Browser ready")

 

    driver = conftest.getChromeDriver()

 

    # Chromedriver connection

    logger.debug("Chromedriver connected")

 

    set_time_to_wait("10")

    logs = conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && sleep '+get_time_to_wait()+'',mytimeout=conftest.LONG_TIMEOUT)

 

    ### Go to https url

    logger.debug("Going to https://www.google.com & wait a little")

    driver.get('https://www.google.com/')  => Here is the timeout issue

 

    set_time_to_wait("10")

    logs = conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && sleep '+get_time_to_wait()+'',mytimeout=conftest.LONG_TIMEOUT)

 

    logger.info("### Debug: Current url is %s", driver.current_url)

    print driver.current_url

    assert 'errorCode' in driver.current_url

 

    ### Quit and close

    driver = None

 

    logger.debug("The end")

 

 

 

def test_https_url_with_certificates(request, set_vars,prepare_test_environment,setup_certificates_env):

 

    ## Connect webdriver and start a view

    assert(conftest.myConnection.isConnected())

 

    # Check certificates are present

    logs =  conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && ls /etc/ssl/certs/*.pem',mytimeout=conftest.LONG_TIMEOUT)

   

    if (conftest.myConnection.isError()==True):

        logger.error( logs)

        assert False

 

    output = ''.join(map(str, logs.encode('utf-8')))

    assert 'Root_CA' in output

 

    # Remove cache

    logs =  conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && rm -rf /tmp/Cache/*',mytimeout=conftest.LONG_TIMEOUT)

    if (conftest.myConnection.isError()==True):

        logger.error( logs)

        assert False

 

    # Restart webengine

    conftest.restart_webengine(request)

 

    # Connect chromedriver

    # Create the initial webview for chromedriver

    logs =  conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && dbus-send '+conftest.DBUS_TYPE+' --type=method_call --print-reply --dest='+conftest.get_browser_name()+' '+conftest.get_browser_path_name()+' '+conftest.get_browser_name()+'.WebView.create string:\''+get_current_view()+'\'',mytimeout=conftest.LONG_TIMEOUT)

    if (conftest.myConnection.isError()==True):

        logger.error( logs)

        assert False

 

    logs = conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && dbus-send '+conftest.DBUS_TYPE+' --type=method_call --print-reply  --dest='+conftest.get_browser_name()+' '+conftest.get_browser_path_name()+' '+conftest.get_browser_name()+'.WebView.start string:\''+get_current_view()+'\' string:\''+get_current_url()+'\'',mytimeout=conftest.LONG_TIMEOUT)

    if (conftest.myConnection.isError()==True):

        logger.error( logs)

        assert False

 

    logger.debug("IWE Browser ready")

 

    driver = conftest.getChromeDriver()

 

    # Chromedriver connection

    logger.debug("Chromedriver connected")

 

    ### Go to https url

    logger.debug("Going to https://www.google.com & wait a little")

    driver.get('https://www.google.com/')

 

    set_time_to_wait("10")

    logs = conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && sleep '+get_time_to_wait()+'',mytimeout=3*conftest.LONG_TIMEOUT)

    print logs

    print driver.current_url

    assert 'errorCode' not in driver.current_url

    assert 'google' in driver.current_url

 

    bt_cookie = driver.find_element_by_class_name('gb_P')

    print bt_cookie.text

    assert 'Gmail' in bt_cookie.text

 

    ### Click on the button

    bt_cookie.click()

    logger.info("### Debug: Current url is %s", driver.current_url)

    print driver.current_url

    assert 'mail' in driver.current_url

 

    set_time_to_wait("10")

    logs = conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && sleep '+get_time_to_wait()+'',mytimeout=conftest.LONG_TIMEOUT)

 

    ### Go to another url

    logger.debug("Going to http://www.apprendre-en-maternelles.com & wait a little")

    driver.get('http://www.apprendre-en-maternelles.com')

    print driver.current_url

    assert 'apprendre-en-maternelles' in driver.current_url

 

    set_time_to_wait("10")

    logs = conftest.myConnection.runCommand(cmd=conftest.getDbusEnvSetting()+' && sleep '+get_time_to_wait()+'',mytimeout=conftest.LONG_TIMEOUT)

 

    ### Quit and close

    driver = None

    #disconnect()

 

    logger.debug("The end")   => No problem


 

PhistucK

 

--

To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.

Reply all
Reply to author
Forward
0 new messages