Intermittent failure on amo.dev - 404 from Selenium server #572

Closed
bobsilverberg opened this Issue Nov 27, 2012 · 6 comments

Comments

Projects
None yet
4 participants
Collaborator

bobsilverberg commented Nov 27, 2012

Most recent failure: http://qa-selenium.mv.mozilla.com:8080/job/amo.dev.mac/1224/

This seems to be an ongoing intermittent issue. The problem is that the call to selenium.get at https://github.com/mozilla/Addon-Tests/blob/master/pages/desktop/details.py#L102 is throwing an exception. I discussed this with @davehunt and the 404 that we see thrown in the stack trace isn't a 404 on the addons page, but rather a 404 from the Selenium server.

I will continue to discuss this with @davehunt, but if anyone has any feedback to share please add it to this issue.

Stack Trace:

self = <tests.desktop.test_details_page.TestDetails instance at 0x104da1e60>
mozwebqa = <pytest_mozwebqa.pytest_mozwebqa.TestSetup instance at 0x104da3830>

@pytest.mark.nondestructive
def test_that_version_information_is_displayed(self, mozwebqa):
    """Test for Litmus 9890."""
  details_page = Details(mozwebqa, 'Firebug')

tests/desktop/test_details_page.py:64:


self = <pages.desktop.details.Details object at 0x104d9d910>
testsetup = <pytest_mozwebqa.pytest_mozwebqa.TestSetup instance at 0x104da3830>
addon_name = 'Firebug'

def __init__(self, testsetup, addon_name=None):
    #formats name for url
    Base.__init__(self, testsetup)
    if (addon_name != None):
        self.addon_name = addon_name.replace(" ", "-")
        self.addon_name = re.sub(r'[^A-Za-z0-9\-]', '', self.addon_name).lower()
        self.addon_name = self.addon_name[:27]
      self.selenium.get("%s/addon/%s" % (self.base_url, self.addon_name))

pages/desktop/details.py:102:


self = <selenium.webdriver.remote.webdriver.WebDriver object at 0x104d9d7d0>
url = 'https://addons-dev.allizom.org/addon/firebug'

def get(self, url):
    """
        Loads a web page in the current browser session.
        """
  self.execute(Command.GET, {'url': url})

.env/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:169:


self = <selenium.webdriver.remote.webdriver.WebDriver object at 0x104d9d7d0>
driver_command = 'get'
params = {'sessionId': u'1353385547764', 'url': 'https://addons-dev.allizom.org/addon/firebug'}

def execute(self, driver_command, params=None):
    """
        Sends a command to be executed by a command.CommandExecutor.

        :Args:
         - driver_command: The name of the command to execute as a string.
         - params: A dictionary of named parameters to send with the command.

        :Returns:
          The command's JSON response loaded into a dictionary object.
        """
    if not params:
        params = {'sessionId': self.session_id}
    elif 'sessionId' not in params:
        params['sessionId'] = self.session_id

    params = self._wrap_value(params)
    response = self.command_executor.execute(driver_command, params)
    if response:
      self.error_handler.check_response(response)

.env/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:157:


self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x104d9d490>
response = {'status': 404, 'value': ''}

def check_response(self, response):
    """
        Checks that a JSON response from the WebDriver does not have an error.

        :Args:
         - response - The JSON response from the WebDriver server as a dictionary
           object.

        :Raises: If the response contains an error message.
        """
    status = response['status']
    if status == ErrorCode.SUCCESS:
        return
    exception_class = ErrorInResponseException
    if status == ErrorCode.NO_SUCH_ELEMENT:
        exception_class = NoSuchElementException
    elif status == ErrorCode.NO_SUCH_FRAME:
        exception_class = NoSuchFrameException
    elif status == ErrorCode.NO_SUCH_WINDOW:
        exception_class = NoSuchWindowException
    elif status == ErrorCode.STALE_ELEMENT_REFERENCE:
        exception_class = StaleElementReferenceException
    elif status == ErrorCode.ELEMENT_NOT_VISIBLE:
        exception_class = ElementNotVisibleException
    elif status == ErrorCode.INVALID_ELEMENT_STATE:
        exception_class = InvalidElementStateException
    elif status == ErrorCode.INVALID_SELECTOR \
            or status == ErrorCode.INVALID_XPATH_SELECTOR \
            or status == ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
        exception_class = InvalidSelectorException
    elif status == ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
        exception_class = ElementNotSelectableException
    elif status == ErrorCode.INVALID_COOKIE_DOMAIN:
        exception_class = WebDriverException
    elif status == ErrorCode.UNABLE_TO_SET_COOKIE:
        exception_class = WebDriverException
    elif status == ErrorCode.TIMEOUT:
        exception_class = TimeoutException
    elif status == ErrorCode.SCRIPT_TIMEOUT:
        exception_class = TimeoutException
    elif status == ErrorCode.UNKNOWN_ERROR:
        exception_class = WebDriverException
    elif status == ErrorCode.NO_ALERT_OPEN:
        exception_class = NoAlertPresentException
    elif status == ErrorCode.IME_NOT_AVAILABLE:
        exception_class = ImeNotAvailableException
    elif status == ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
        exception_class = ImeActivationFailedException
    elif status == ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
        exception_class = MoveTargetOutOfBoundsException
    else:
        exception_class = WebDriverException
    value = response['value']
    if type(value) is str:
        if exception_class == ErrorInResponseException:
            raise exception_class(response, value)
      raise exception_class(value)

E WebDriverException: Message: ''

.env/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py:127: WebDriverException

Collaborator

bobsilverberg commented Nov 27, 2012

http://qa-selenium.mv.mozilla.com:8080/job/amo.dev.mac/1228/ had the same type of failure. A different test, but again a 404 from the Selenium server. I will continue to track these in this issue and perhaps this is something to discuss with #selenium?

Collaborator

bobsilverberg commented Dec 20, 2012

These intermittent technical failures are no longer plaguing our tests thanks to @klrmn's pytest-rerunfailures plugin. I'm not sure if I should close this issue or not, though. Any thoughts from anyone on that?

Member

retornam commented Sep 17, 2013

@bobsilverberg is this issue stil valid or can it be closed?

Contributor

chirarobert commented Feb 6, 2014

@bobsilverberg @retornam any updates on this issue? can it be closed?

Member

retornam commented Feb 6, 2014

@bobsilverberg knows more about this than I do

Contributor

AndreiH commented Feb 10, 2014

I think this issue can be closet thanks to @klrmn 's rerunfauilures plugin.
@bobsilverberg I will close this. Reopen if you disagree

AndreiH closed this Feb 10, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment