OwnLearnerProfilePageTest.test_user_can_upload_the_profile_image_with_success fails intermittently

Description

This test fails intermittently and has been removed from the codebase.

For triaging this bug:

  • Until proven one way or the other, it could be either the code that is flaky or the test that is flaky.

  • The test has been removed from the codebase, and thus the functionality is no longer covered by bok-choy test.

    • Evaluate whether or not it is or can be covered by a lower level (e.g. python or JS unit test) and thus the test was unnecessary, or if there is now risk that a bug in the code could escape and thus the test should be fixed and re-enabled.

The test was deleted in this PR.

OwnLearnerProfilePageTest.test_user_can_upload_the_profile_image_with_success failed in this build on jenkins and passed in the subsequent build on the same commit .

Error Message

1 StaleElementReferenceException: Message: The element reference of <textarea id="u-field-textarea-bio"> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed

Stacktrace

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 22:37:37 =================================== FAILURES =================================== 22:37:37 OwnLearnerProfilePageTest.test_user_can_upload_the_profile_image_with_success _ 22:37:37 22:37:37 self = <common.test.acceptance.tests.lms.test_learner_profile.OwnLearnerProfilePageTest testMethod=test_user_can_upload_the_profile_image_with_success> 22:37:37 22:37:37 def test_user_can_upload_the_profile_image_with_success(self): 22:37:37 """ 22:37:37 Scenario: Upload profile image works correctly. 22:37:37 22:37:37 Given that I am on my profile page with public access 22:37:37 And I can see default image 22:37:37 When I move my cursor to the image 22:37:37 Then i can see the upload/remove image text 22:37:37 When i upload new image via file uploader 22:37:37 Then i can see the changed image 22:37:37 And i can also see the latest image after reload. 22:37:37 """ 22:37:37 username, user_id = self.log_in_as_unique_user() 22:37:37 > profile_page = self.visit_profile_page(username, privacy=self.PRIVACY_PUBLIC) 22:37:37 22:37:37 common/test/acceptance/tests/lms/test_learner_profile.py:414: 22:37:37 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 22:37:37 common/test/acceptance/tests/lms/test_learner_profile.py:75: in visit_profile_page 22:37:37 self.set_public_profile_fields_data(profile_page) 22:37:37 common/test/acceptance/tests/lms/test_learner_profile.py:49: in set_public_profile_fields_data 22:37:37 profile_page.set_value_for_textarea_field('bio', 'Nothing Special') 22:37:37 common/test/acceptance/pages/lms/fields.py:184: in set_value_for_textarea_field 22:37:37 query.results[0].send_keys(u'\ue007') # Press Enter 22:37:37 ../../edx-venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py:479: in send_keys 22:37:37 'value': keys_to_typing(value)}) 22:37:37 ../../edx-venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webelement.py:633: in _execute 22:37:37 return self._parent.execute(command, params) 22:37:37 ../../edx-venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py:321: in execute 22:37:37 self.error_handler.check_response(response) 22:37:37 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 22:37:37 22:37:37 self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7f70146dc050> 22:37:37 response = {'status': 404, 'value': '{"value":{"error":"stale element reference","message":"The element reference of <textarea id...</req<@chrome://marionette/content/listener.js:485:20\ndispatch/<@chrome://marionette/content/listener.js:484:15\n"}}'} 22:37:37 22:37:37 def check_response(self, response): 22:37:37 """ 22:37:37 Checks that a JSON response from the WebDriver does not have an error. 22:37:37 22:37:37 :Args: 22:37:37 - response - The JSON response from the WebDriver server as a dictionary 22:37:37 object. 22:37:37 22:37:37 :Raises: If the response contains an error message. 22:37:37 """ 22:37:37 status = response.get('status', None) 22:37:37 if status is None or status == ErrorCode.SUCCESS: 22:37:37 return 22:37:37 value = None 22:37:37 message = response.get("message", "") 22:37:37 screen = response.get("screen", "") 22:37:37 stacktrace = None 22:37:37 if isinstance(status, int): 22:37:37 value_json = response.get('value', None) 22:37:37 if value_json and isinstance(value_json, basestring): 22:37:37 import json 22:37:37 try: 22:37:37 value = json.loads(value_json) 22:37:37 if len(value.keys()) == 1: 22:37:37 value = value['value'] 22:37:37 status = value.get('error', None) 22:37:37 if status is None: 22:37:37 status = value["status"] 22:37:37 message = value["value"] 22:37:37 if not isinstance(message, basestring): 22:37:37 value = message 22:37:37 message = message.get('message') 22:37:37 else: 22:37:37 message = value.get('message', None) 22:37:37 except ValueError: 22:37:37 pass 22:37:37 22:37:37 exception_class = ErrorInResponseException 22:37:37 if status in ErrorCode.NO_SUCH_ELEMENT: 22:37:37 exception_class = NoSuchElementException 22:37:37 elif status in ErrorCode.NO_SUCH_FRAME: 22:37:37 exception_class = NoSuchFrameException 22:37:37 elif status in ErrorCode.NO_SUCH_WINDOW: 22:37:37 exception_class = NoSuchWindowException 22:37:37 elif status in ErrorCode.STALE_ELEMENT_REFERENCE: 22:37:37 exception_class = StaleElementReferenceException 22:37:37 elif status in ErrorCode.ELEMENT_NOT_VISIBLE: 22:37:37 exception_class = ElementNotVisibleException 22:37:37 elif status in ErrorCode.INVALID_ELEMENT_STATE: 22:37:37 exception_class = InvalidElementStateException 22:37:37 elif status in ErrorCode.INVALID_SELECTOR \ 22:37:37 or status in ErrorCode.INVALID_XPATH_SELECTOR \ 22:37:37 or status in ErrorCode.INVALID_XPATH_SELECTOR_RETURN_TYPER: 22:37:37 exception_class = InvalidSelectorException 22:37:37 elif status in ErrorCode.ELEMENT_IS_NOT_SELECTABLE: 22:37:37 exception_class = ElementNotSelectableException 22:37:37 elif status in ErrorCode.ELEMENT_NOT_INTERACTABLE: 22:37:37 exception_class = ElementNotInteractableException 22:37:37 elif status in ErrorCode.INVALID_COOKIE_DOMAIN: 22:37:37 exception_class = InvalidCookieDomainException 22:37:37 elif status in ErrorCode.UNABLE_TO_SET_COOKIE: 22:37:37 exception_class = UnableToSetCookieException 22:37:37 elif status in ErrorCode.TIMEOUT: 22:37:37 exception_class = TimeoutException 22:37:37 elif status in ErrorCode.SCRIPT_TIMEOUT: 22:37:37 exception_class = TimeoutException 22:37:37 elif status in ErrorCode.UNKNOWN_ERROR: 22:37:37 exception_class = WebDriverException 22:37:37 elif status in ErrorCode.UNEXPECTED_ALERT_OPEN: 22:37:37 exception_class = UnexpectedAlertPresentException 22:37:37 elif status in ErrorCode.NO_ALERT_OPEN: 22:37:37 exception_class = NoAlertPresentException 22:37:37 elif status in ErrorCode.IME_NOT_AVAILABLE: 22:37:37 exception_class = ImeNotAvailableException 22:37:37 elif status in ErrorCode.IME_ENGINE_ACTIVATION_FAILED: 22:37:37 exception_class = ImeActivationFailedException 22:37:37 elif status in ErrorCode.MOVE_TARGET_OUT_OF_BOUNDS: 22:37:37 exception_class = MoveTargetOutOfBoundsException 22:37:37 elif status in ErrorCode.JAVASCRIPT_ERROR: 22:37:37 exception_class = JavascriptException 22:37:37 elif status in ErrorCode.SESSION_NOT_CREATED: 22:37:37 exception_class = SessionNotCreatedException 22:37:37 elif status in ErrorCode.INVALID_ARGUMENT: 22:37:37 exception_class = InvalidArgumentException 22:37:37 elif status in ErrorCode.NO_SUCH_COOKIE: 22:37:37 exception_class = NoSuchCookieException 22:37:37 elif status in ErrorCode.UNABLE_TO_CAPTURE_SCREEN: 22:37:37 exception_class = ScreenshotException 22:37:37 elif status in ErrorCode.ELEMENT_CLICK_INTERCEPTED: 22:37:37 exception_class = ElementClickInterceptedException 22:37:37 elif status in ErrorCode.INSECURE_CERTIFICATE: 22:37:37 exception_class = InsecureCertificateException 22:37:37 elif status in ErrorCode.INVALID_COORDINATES: 22:37:37 exception_class = InvalidCoordinatesException 22:37:37 elif status in ErrorCode.INVALID_SESSION_ID: 22:37:37 exception_class = InvalidSessionIdException 22:37:37 elif status in ErrorCode.UNKNOWN_METHOD: 22:37:37 exception_class = UnknownMethodException 22:37:37 else: 22:37:37 exception_class = WebDriverException 22:37:37 if value == '' or value is None: 22:37:37 value = response['value'] 22:37:37 if isinstance(value, basestring): 22:37:37 if exception_class == ErrorInResponseException: 22:37:37 raise exception_class(response, value) 22:37:37 raise exception_class(value) 22:37:37 if message == "" and 'message' in value: 22:37:37 message = value['message'] 22:37:37 22:37:37 screen = None 22:37:37 if 'screen' in value: 22:37:37 screen = value['screen'] 22:37:37 22:37:37 stacktrace = None 22:37:37 if 'stackTrace' in value and value['stackTrace']: 22:37:37 stacktrace = [] 22:37:37 try: 22:37:37 for frame in value['stackTrace']: 22:37:37 line = self._value_or_default(frame, 'lineNumber', '') 22:37:37 file = self._value_or_default(frame, 'fileName', '<anonymous>') 22:37:37 if line: 22:37:37 file = "%s:%s" % (file, line) 22:37:37 meth = self._value_or_default(frame, 'methodName', '<anonymous>') 22:37:37 if 'className' in frame: 22:37:37 meth = "%s.%s" % (frame['className'], meth) 22:37:37 msg = " at %s (%s)" 22:37:37 msg = msg % (meth, file) 22:37:37 stacktrace.append(msg) 22:37:37 except TypeError: 22:37:37 pass 22:37:37 if exception_class == ErrorInResponseException: 22:37:37 raise exception_class(response, message) 22:37:37 elif exception_class == UnexpectedAlertPresentException: 22:37:37 alert_text = None 22:37:37 if 'data' in value: 22:37:37 alert_text = value['data'].get('text') 22:37:37 elif 'alert' in value: 22:37:37 alert_text = value['alert'].get('text') 22:37:37 raise exception_class(message, screen, stacktrace, alert_text) 22:37:37 > raise exception_class(message, screen, stacktrace) 22:37:37 E StaleElementReferenceException: Message: The element reference of <textarea id="u-field-textarea-bio"> is stale; either the element is no longer attached to the DOM, it is not in the current frame context, or the document has been refreshed 22:37:37 22:37:37 ../../edx-venv/local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py:242: StaleElementReferenceException

Steps to Reproduce

None

Current Behavior

None

Expected Behavior

None

Reason for Variance

None

Release Notes

None

User Impact Summary

None

Status

Assignee

Unassigned

Reporter

Matthew Hughes

Labels

Reach

None

Impact

None

Customer

None

Partner Manager

None

URL

None

Contributor Name

None

Groups with Read-Only Access

None

Actual Points

None

Category of Work

None

Stakeholders

None

Priority

CAT-5
Configure