← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1404379] [NEW] Selenium driver function 'current_url' is wrongly called in integration tests

 

Public bug reported:

BASIC INFO:
The function defined in selenium, is getting called in integration tests as :
self.driver.current_url()
While the official selenium documentation says it should be called as:
self.driver.current_url

The function call is made actually in pageobject.py (base file for all
integration tests) but since no tests actually uses it, we dont see the
error, if you modify tests to use this call, it will definitely throw an
error because actual function defined in selenium is a property function
that get called differently than normal function in python are called .

DETAILS:
The integration tests which are basically selenium based UI tests, have a lot of useful helper functions wrapped around actual calls you would make to selenium module. 
One of the function defined `horizon/openstack_dashboard/test/integration_tests/pages/pageobject.py` is:
    def get_url_current_page(self):
        return self.driver.current_url()
Source: https://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/test/integration_tests/pages/pageobject.py#n37

Its obviously not used in any of existing tests but if you try to use
this function, it throws an error.

So looking at the official selenium code, I found the its actually being called wrongly. 'current_url` is a property function which act as getters/setters in python so they cant be called as normal function like `func()`  but correct way is `func`
Source:
https://code.google.com/p/selenium/source/browse/py/selenium/webdriver/remote/webdriver.py#425

FIX: just changing the 'current_url()' to 'current_url' will fix it )

** Affects: horizon
     Importance: Undecided
         Status: New


** Tags: integration-tests selenium

** Summary changed:

- Selenium driver property function 'current_url' is wrongly called in integration tests
+ Selenium driver function 'current_url' is wrongly called in integration tests

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1404379

Title:
  Selenium driver function 'current_url' is wrongly called in
  integration tests

Status in OpenStack Dashboard (Horizon):
  New

Bug description:
  BASIC INFO:
  The function defined in selenium, is getting called in integration tests as :
  self.driver.current_url()
  While the official selenium documentation says it should be called as:
  self.driver.current_url

  The function call is made actually in pageobject.py (base file for all
  integration tests) but since no tests actually uses it, we dont see
  the error, if you modify tests to use this call, it will definitely
  throw an error because actual function defined in selenium is a
  property function that get called differently than normal function in
  python are called .

  DETAILS:
  The integration tests which are basically selenium based UI tests, have a lot of useful helper functions wrapped around actual calls you would make to selenium module. 
  One of the function defined `horizon/openstack_dashboard/test/integration_tests/pages/pageobject.py` is:
      def get_url_current_page(self):
          return self.driver.current_url()
  Source: https://git.openstack.org/cgit/openstack/horizon/tree/openstack_dashboard/test/integration_tests/pages/pageobject.py#n37

  Its obviously not used in any of existing tests but if you try to use
  this function, it throws an error.

  So looking at the official selenium code, I found the its actually being called wrongly. 'current_url` is a property function which act as getters/setters in python so they cant be called as normal function like `func()`  but correct way is `func`
  Source:
  https://code.google.com/p/selenium/source/browse/py/selenium/webdriver/remote/webdriver.py#425

  FIX: just changing the 'current_url()' to 'current_url' will fix it )

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1404379/+subscriptions


Follow ups

References