Selenium tests fail if run with '--with-selenium' switch

Bug #1384666 reported by Timur Sufiev
14
This bug affects 3 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
utsav dusad

Bug Description

Selenium tests pass if run with command `tox -evenv -- /bin/bash run_tests.sh -N --only-selenium` or `tools/with_venv.sh ./run_tests.sh --only-selenium`, but fail if run with `tox -evenv -- /bin/bash run_tests.sh -N --with-selenium` with the following errors:

======================================================================
ERROR: test_inline_editing_cancel (openstack_dashboard.dashboards.identity.projects.tests.SeleniumTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/timur/develop/horizon/openstack_dashboard/test/helpers.py", line 80, in instance_stub_out
    return fn(self, *args, **kwargs)
  File "/home/timur/develop/horizon/openstack_dashboard/dashboards/identity/projects/tests.py", line 1748, in test_inline_editing_cancel
    "//td[@data-update-url='/identity/?action=cell_update"
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 230, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 662, in find_element
    {'using': by, 'value': value})['value']
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 173, in execute
    self.error_handler.check_response(response)
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 166, in check_response
    raise exception_class(message, screen, stacktrace)
NoSuchElementException: Message: u'Unable to locate element: {"method":"xpath","selector":"//td[@data-update-url=\'/identity/?action=cell_update&table=tenants&cell_name=name&obj_id=1\']"}' ; Stacktrace:
    at FirefoxDriver.prototype.findElementInternal_ (file:///<email address hidden>/components/driver-component.js:9618:26)
    at fxdriver.Timer.prototype.setTimeout/<.notify (file:///<email address hidden>/components/driver-component.js:548:5)

======================================================================
ERROR: test_inline_editing_cancel (openstack_dashboard.dashboards.identity.projects.tests.SeleniumTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/timur/develop/horizon/openstack_dashboard/test/helpers.py", line 404, in tearDown
    self.mox.VerifyAll()
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/mox.py", line 286, in VerifyAll
    mock_obj._Verify()
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/mox.py", line 506, in _Verify
    raise ExpectedMethodCallsError(self._expected_calls_queue)
ExpectedMethodCallsError: Verify: Expected methods never called:
  0. tenant_get.__call__(<IgnoreArg>, u'1', admin=True) -> <Tenant {'description': 'a test tenant.', 'enabled': True, 'domain_name': 'test_domain', 'id': '1', 'domain_id': '1', 'name': 'test_tenant'}>

======================================================================
ERROR: test_inline_editing_update (openstack_dashboard.dashboards.identity.projects.tests.SeleniumTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/timur/develop/horizon/openstack_dashboard/test/helpers.py", line 80, in instance_stub_out
    return fn(self, *args, **kwargs)
  File "/home/timur/develop/horizon/openstack_dashboard/dashboards/identity/projects/tests.py", line 1684, in test_inline_editing_update
    "//td[@data-update-url='/identity/?action=cell_update"
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 230, in find_element_by_xpath
    return self.find_element(by=By.XPATH, value=xpath)
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 662, in find_element
    {'using': by, 'value': value})['value']
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 173, in execute
    self.error_handler.check_response(response)
  File "/home/timur/develop/horizon/.venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 166, in check_response
    raise exception_class(message, screen, stacktrace)
NoSuchElementException: Message: u'Unable to locate element: {"method":"xpath","selector":"//td[@data-update-url=\'/identity/?action=cell_update&table=tenants&cell_name=name&obj_id=1\']"}' ; Stacktrace:
    at FirefoxDriver.prototype.findElementInternal_ (file:///<email address hidden>/components/driver-component.js:9618:26)
    at fxdriver.Timer.prototype.setTimeout/<.notify (file:///<email address hidden>/components/driver-component.js:548:5)

Tags: unittest
Revision history for this message
Julie Pichon (jpichon) wrote :

Seen on both master and stable/icehouse (I assume stable/juno is affected too). When it doesn't work one sees only "500 error" displayed in the browser window that pops up, which is why the tests are failing since no element can be found. It occurs whether the tests are ran headlessly or not.

However it doesn't happen either when running a subset of tests, e.g. openstack_dashboard.dashboards.identity.projects.tests. Something appears to be leaking somewhere...

Changed in horizon:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

The bug encountered on stable/icehouse, stable/juno, master.

tags: added: unittest
utsav dusad (utsavdusad)
Changed in horizon:
assignee: nobody → utsav dusad (utsavdusad)
Revision history for this message
utsav dusad (utsavdusad) wrote :

I am also getting this 500 Error on running the command "tox -evenv -- /bin/bash run_tests.sh -N --with-selenium".
But, if I run stack.sh and after that on running the above command the test got successfully competed without any error.

utsav dusad (utsavdusad)
information type: Public → Public Security
information type: Public Security → Public
Revision history for this message
Timur Sufiev (tsufiev-x) wrote :

Checked it again. --with-selenium switch works fine since stable/kilo. Marking as Fix Released.

Changed in horizon:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.