Advertisement
Guest User

Untitled

a guest
Dec 18th, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 9.92 KB | None | 0 0
  1. tests.desktop.test_search.TestSearch.test_searching_for_addon_type_returns_results_of_correct_type[Collections-web-Collections] (from )
  2. Failing for the past 1 build (Since Failed#2005 )
  3. Took 1 min 52 sec.
  4. add description
  5. Error Message
  6.  
  7. test failure
  8.  
  9. Stacktrace
  10.  
  11. self = <tests.desktop.test_search.TestSearch instance at 0x10a9c8b48>
  12. mozwebqa = <pytest_mozwebqa.pytest_mozwebqa.TestSetup instance at 0x10a81e170>
  13. addon_type = 'Collections', term = 'web', breadcrumb_component = 'Collections'
  14.  
  15.     @pytest.mark.xfail("'addons.allizom' in config.getvalue('base_url')",
  16.                        reason='https://github.com/mozilla/Addon-Tests/issues/728')
  17.     @pytest.mark.native
  18.     @pytest.mark.nondestructive
  19.     @pytest.mark.smoke
  20.     @pytest.mark.parametrize(('addon_type', 'term', 'breadcrumb_component'), [
  21.         ('Complete Themes', 'nasa', 'Complete Themes'),           # 17350
  22.         ('Extensions', 'fire', 'Extensions'),
  23.         ('Themes', 'fox', 'Themes'),        # 17349
  24.         ('Collections', 'web', 'Collections'),  # 17352
  25.         # these last two depend on the More menu
  26.         # ('Add-ons for Mobile', 'fire', 'Extensions')
  27.         # ('Dictionaries & Language Packs', 'a', 'Dictionaries'),
  28.     ])
  29.     def test_searching_for_addon_type_returns_results_of_correct_type(
  30.         self, mozwebqa, addon_type, term, breadcrumb_component
  31.     ):
  32.         amo_home_page = Home(mozwebqa)
  33.    
  34.         if (addon_type == 'Complete Themes'):
  35.             # Complete Themes are in a subnav, so must be clicked differently
  36.             amo_addon_type_page = amo_home_page.header.click_complete_themes()
  37.         else:
  38.             amo_addon_type_page = amo_home_page.header.site_navigation_menu(addon_type).click()
  39.         search_results = amo_addon_type_page.search_for(term)
  40.    
  41.         Assert.true(search_results.result_count > 0)
  42.    
  43.         for i in range(search_results.result_count):
  44.             addon = search_results.result(i).click_result()
  45. >           Assert.contains(breadcrumb_component, addon.breadcrumb)
  46.  
  47. tests/desktop/test_search.py:234:
  48. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  49.  
  50. self = <pages.desktop.collections.Collection object at 0x10a9bd1d0>
  51.  
  52.     @property
  53.     def breadcrumb(self):
  54. >       return self.selenium.find_element(*self._breadcrumb_locator).text
  55.  
  56. pages/desktop/collections.py:88:
  57. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  58.  
  59. self = <selenium.webdriver.remote.webdriver.WebDriver object at 0x10a82f410>
  60. by = 'id', value = 'breadcrumbs'
  61.  
  62.     def find_element(self, by=By.ID, value=None):
  63.         """
  64.            'Private' method used by the find_element_by_* methods.
  65.    
  66.            :Usage:
  67.                Use the corresponding find_element_by_* instead of this.
  68.    
  69.            :rtype: WebElement
  70.            """
  71.         if not By.is_valid(by) or not isinstance(value, str):
  72.             raise InvalidSelectorException("Invalid locator values passed in")
  73.    
  74.         return self.execute(Command.FIND_ELEMENT,
  75. >                            {'using': by, 'value': value})['value']
  76.  
  77. .env/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:662:
  78. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  79.  
  80. self = <selenium.webdriver.remote.webdriver.WebDriver object at 0x10a82f410>
  81. driver_command = 'findElement'
  82. params = {'sessionId': u'4b8d809d7d3d4b9c8500369ea1615ef0', 'using': 'id', 'value': 'breadcrumbs'}
  83.  
  84.     def execute(self, driver_command, params=None):
  85.         """
  86.            Sends a command to be executed by a command.CommandExecutor.
  87.    
  88.            :Args:
  89.             - driver_command: The name of the command to execute as a string.
  90.             - params: A dictionary of named parameters to send with the command.
  91.    
  92.            :Returns:
  93.              The command's JSON response loaded into a dictionary object.
  94.            """
  95.         if self.session_id is not None:
  96.             if not params:
  97.                 params = {'sessionId': self.session_id}
  98.             elif 'sessionId' not in params:
  99.                 params['sessionId'] = self.session_id
  100.    
  101.         params = self._wrap_value(params)
  102.         response = self.command_executor.execute(driver_command, params)
  103.         if response:
  104. >           self.error_handler.check_response(response)
  105.  
  106. .env/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:173:
  107. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  108.  
  109. self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x10a834490>
  110. response = {u'class': u'org.openqa.selenium.remote.Response', u'hCode': 17068716, u'sessionId': u'4b8d809d7d3d4b9c8500369ea1615ef0', u'state': u'no such element', ...}
  111.  
  112.     def check_response(self, response):
  113.         """
  114.            Checks that a JSON response from the WebDriver does not have an error.
  115.    
  116.            :Args:
  117.             - response - The JSON response from the WebDriver server as a dictionary
  118.               object.
  119.    
  120.            :Raises: If the response contains an error message.
  121.            """
  122.         status = response['status']
  123.         if status == ErrorCode.SUCCESS:
  124.             return
  125.         exception_class = ErrorInResponseException
  126.         if status in ErrorCode.NO_SUCH_ELEMENT:
  127.             exception_class = NoSuchElementException
  128.         elif status in ErrorCode.NO_SUCH_FRAME:
  129.             exception_class = NoSuchFrameException
  130.         elif status in ErrorCode.NO_SUCH_WINDOW:
  131.             exception_class = NoSuchWindowException
  132.         elif status in ErrorCode.STALE_ELEMENT_REFERENCE:
  133.             exception_class = StaleElementReferenceException
  134.         elif status in ErrorCode.ELEMENT_NOT_VISIBLE:
  135.             exception_class = ElementNotVisibleException
  136.         elif status in ErrorCode.INVALID_ELEMENT_STATE:
  137.             exception_class = InvalidElementStateException
  138.         elif status in ErrorCode.INVALID_SELECTOR \
  139.                 or status in ErrorCode.INVALID_XPATH_SELECTOR \
  140.                 or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER:
  141.             exception_class = InvalidSelectorException
  142.         elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE:
  143.             exception_class = ElementNotSelectableException
  144.         elif status in ErrorCode.INVALID_COOKIE_DOMAIN:
  145.             exception_class = WebDriverException
  146.         elif status in ErrorCode.UNABLE_TO_SET_COOKIE:
  147.             exception_class = WebDriverException
  148.         elif status in ErrorCode.TIMEOUT:
  149.             exception_class = TimeoutException
  150.         elif status in ErrorCode.SCRIPT_TIMEOUT:
  151.             exception_class = TimeoutException
  152.         elif status in ErrorCode.UNKNOWN_ERROR:
  153.             exception_class = WebDriverException
  154.         elif status in ErrorCode.UNEXPECTED_ALERT_OPEN:
  155.             exception_class = UnexpectedAlertPresentException
  156.         elif status in ErrorCode.NO_ALERT_OPEN:
  157.             exception_class = NoAlertPresentException
  158.         elif status in ErrorCode.IME_NOT_AVAILABLE:
  159.             exception_class = ImeNotAvailableException
  160.         elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED:
  161.             exception_class = ImeActivationFailedException
  162.         elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS:
  163.             exception_class = MoveTargetOutOfBoundsException
  164.         else:
  165.             exception_class = WebDriverException
  166.         value = response['value']
  167.         if isinstance(value, basestring):
  168.             if exception_class == ErrorInResponseException:
  169.                 raise exception_class(response, value)
  170.             raise exception_class(value)
  171.         message = ''
  172.         if 'message' in value:
  173.             message = value['message']
  174.    
  175.         screen = None
  176.         if 'screen' in value:
  177.             screen = value['screen']
  178.    
  179.         stacktrace = None
  180.         if 'stackTrace' in value and value['stackTrace']:
  181.             stacktrace = []
  182.             try:
  183.                 for frame in value['stackTrace']:
  184.                     line = self._value_or_default(frame, 'lineNumber', '')
  185.                     file = self._value_or_default(frame, 'fileName', '<anonymous>')
  186.                     if line:
  187.                         file = "%s:%s" % (file, line)
  188.                     meth = self._value_or_default(frame, 'methodName', '<anonymous>')
  189.                     if 'className' in frame:
  190.                         meth = "%s.%s" % (frame['className'], meth)
  191.                     msg = "    at %s (%s)"
  192.                     msg = msg % (meth, file)
  193.                     stacktrace.append(msg)
  194.             except TypeError:
  195.                 pass
  196.         if exception_class == ErrorInResponseException:
  197.             raise exception_class(response, message)
  198.         elif exception_class == UnexpectedAlertPresentException and 'alert' in value:
  199.             raise exception_class(message, screen, stacktrace, value['alert'].get('text'))
  200. >       raise exception_class(message, screen, stacktrace)
  201. E       NoSuchElementException: Message: Unable to locate element: {"method":"id","selector":"breadcrumbs"}
  202. E       For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
  203. E       Build info: version: '2.43.0', revision: '597b76b', time: '2014-09-09 20:52:14'
  204. E       System info: host: 'WIN-R1JBAO1CNPS', ip: '172.20.43.124', os.name: 'Windows Server 2008 R2', os.arch: 'x86', os.version: '6.1', java.version: '1.7.0_60'
  205. E       Driver info: driver.version: unknown
  206. E       Stacktrace:
  207. E           at <anonymous class>.FirefoxDriver.prototype.findElementInternal_ (file:///C:/Users/ADMINI~1/AppData/Local/Temp/anonymous5100687929099589452webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:9618:133)
  208. E           at <anonymous class>.fxdriver.Timer.prototype.setTimeout/<.notify (file:///C:/Users/ADMINI~1/AppData/Local/Temp/anonymous5100687929099589452webdriver-profile/extensions/fxdriver@googlecode.com/components/driver-component.js:548:5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement