serhatbolsu / robotframework-appiumlibrary

AppiumLibrary is an appium testing library for RobotFramework
Apache License 2.0
403 stars 291 forks source link

Errors when attempting operations in native context on https://m.youtube.com #221

Closed pandabat closed 2 years ago

pandabat commented 6 years ago

It seems that we've only begun seeing this issue since the 18th May and only on the site: https://m.youtube.com

Testing with Appium desktop 1.6.1 and Chromedriver 2.38 and Android 4.4 device. Same tests on a 7.12 boxes seem to pass.

After opening https://m.youtube.com within our browser in webview mode, we're basically running the following:

`AppiumLibrary.Wait Until Page Contains    ${SHORTCUT_NAME}
Switch To Native Context
Browser Page Load Timeout /*this is 15s delay */
AppiumLibrary.Wait Until Page Contains    ${SHORTCUT_NAME}`

Attempting to check for the text "YouTube" when in native context seems to trigger the error (as does attempting other such operations in native mode, e.g. Log Source)

Doesn't seem to happen on other sites (e.g. Facebook, Twitter, Gmail, LinkedIn, Wikipedia, Google) - only https://m.youtube.com seems to be affected. Upon failure, we're attempting to Log Source and capture a screenshot.

Robot reports 'WebDriverException: Message: An unknown server-side error occurred while processing the command --'

Debug Logs from Robot follow (errors begin at 20180522 15:13:53.361):

20180522 15:13:18.331 - INFO - +---- START KW: BuiltIn.Set Global Variable [ ${SHORTCUT_URL} ] 20180522 15:13:18.332 - INFO - ${SHORTCUT_URL} = http://www.youtube.com/ 20180522 15:13:18.332 - INFO - +---- END KW: BuiltIn.Set Global Variable (1) 20180522 15:13:18.332 - INFO - +---- START KW: 02-MDL-KEYWORDS.Browser Page Load Timeout [ ] 20180522 15:13:18.333 - INFO - +----- START KW: BuiltIn.Sleep [ ${BROWSER_PAGE_LOAD_TIMEOUT} ] 20180522 15:13:33.333 - INFO - Slept 15 seconds 20180522 15:13:33.334 - INFO - +----- END KW: BuiltIn.Sleep (15001) 20180522 15:13:33.334 - INFO - +---- END KW: 02-MDL-KEYWORDS.Browser Page Load Timeout (15002) 20180522 15:13:33.335 - INFO - +---- START KW: AppiumLibrary.Wait Until Page Contains [ ${SHORTCUT_NAME} ] 20180522 15:13:33.428 - INFO - +---- END KW: AppiumLibrary.Wait Until Page Contains (94) 20180522 15:13:33.428 - INFO - +---- START KW: 02-MDL-KEYWORDS.Switch To Native Context [ ] 20180522 15:13:33.429 - INFO - +----- START KW: AppiumLibrary.Switch To Context [ NATIVE_APP ] 20180522 15:13:33.484 - INFO - +----- END KW: AppiumLibrary.Switch To Context (55) 20180522 15:13:33.485 - INFO - +----- START KW: BuiltIn.Sleep [ ${CONTEXT_CHANGE_TIMEOUT} ] 20180522 15:13:33.685 - INFO - Slept 200 milliseconds 20180522 15:13:33.686 - INFO - +----- END KW: BuiltIn.Sleep (200) 20180522 15:13:33.686 - INFO - +---- END KW: 02-MDL-KEYWORDS.Switch To Native Context (258) 20180522 15:13:33.686 - INFO - +---- START KW: 02-MDL-KEYWORDS.Browser Page Load Timeout [ ] 20180522 15:13:33.686 - INFO - +----- START KW: BuiltIn.Sleep [ ${BROWSER_PAGE_LOAD_TIMEOUT} ] 20180522 15:13:48.687 - INFO - Slept 15 seconds 20180522 15:13:48.688 - INFO - +----- END KW: BuiltIn.Sleep (15001) 20180522 15:13:48.688 - INFO - +---- END KW: 02-MDL-KEYWORDS.Browser Page Load Timeout (15002) 20180522 15:13:48.688 - INFO - +---- START KW: AppiumLibrary.Wait Until Page Contains [ ${SHORTCUT_NAME} ] 20180522 15:13:48.997 - INFO - +----- START KW: 02-MDL-KEYWORDS.Capture Page Screenshot With Context [ ] 20180522 15:13:48.998 - INFO - +------ START KW: AppiumLibrary.Get Current Context [ ] 20180522 15:13:49.004 - INFO - ${saved_context} = NATIVEAPP 20180522 15:13:49.004 - INFO - +------ END KW: AppiumLibrary.Get Current Context (6) 20180522 15:13:49.004 - INFO - +------ START KW: BuiltIn.Get Time [ year,month,day,hour,minute,second ] 20180522 15:13:49.005 - INFO - ${year} = 2018 20180522 15:13:49.005 - INFO - ${month} = 05 20180522 15:13:49.005 - INFO - ${day} = 22 20180522 15:13:49.005 - INFO - ${hour} = 15 20180522 15:13:49.006 - INFO - ${minute} = 13 20180522 15:13:49.006 - INFO - ${second} = 49 20180522 15:13:49.006 - INFO - +------ END KW: BuiltIn.Get Time (2) 20180522 15:13:49.006 - INFO - +------ START KW: BuiltIn.Set Variable [ ${year}${month}${day}${hour}${minute}${second} ] 20180522 15:13:49.007 - INFO - ${screenshot_name} = 20180522_151349 20180522 15:13:49.007 - INFO - +------ END KW: BuiltIn.Set Variable (1) 20180522 15:13:49.007 - INFO - +------ START KW: AppiumLibrary.Capture Page Screenshot [ ${screenshot_name}.png ] 20180522 15:13:53.056 - INFO - 20180522 15:13:53.056 - INFO - +------ END KW: AppiumLibrary.Capture Page Screenshot (4049) 20180522 15:13:53.056 - INFO - +------ START KW: AppiumLibrary.Log Source [ ] 20180522 15:13:53.360 - FAIL - WebDriverException: Message: An unknown server-side error occurred while processing the command. 20180522 15:13:53.361 - DEBUG - Traceback (most recent call last): File "", line 2, in log_source File "/usr/lib/python2.7/site-packages/AppiumLibrary/keywords/keywordgroup.py", line 20, in _run_on_failure_decorator raise err 20180522 15:13:53.361 - INFO - +------ END KW: AppiumLibrary.Log Source (305) 20180522 15:13:53.361 - INFO - +----- END KW: 02-MDL-KEYWORDS.Capture Page Screenshot With Context (4364) 20180522 15:13:53.361 - WARN - Keyword 'Capture Page Screenshot With Context' could not be run on failure: WebDriverException: Message: An unknown server-side error occurred while processing the command. 20180522 15:13:53.361 - INFO - +----- START KW: 02-MDL-KEYWORDS.Capture Page Screenshot With Context [ ] 20180522 15:13:53.362 - INFO - +------ START KW: AppiumLibrary.Get Current Context [ ] 20180522 15:13:53.366 - INFO - ${saved_context} = NATIVEAPP 20180522 15:13:53.366 - INFO - +------ END KW: AppiumLibrary.Get Current Context (4) 20180522 15:13:53.366 - INFO - +------ START KW: BuiltIn.Get Time [ year,month,day,hour,minute,second ] 20180522 15:13:53.366 - INFO - ${year} = 2018 20180522 15:13:53.367 - INFO - ${month} = 05 20180522 15:13:53.367 - INFO - ${day} = 22 20180522 15:13:53.367 - INFO - ${hour} = 15 20180522 15:13:53.367 - INFO - ${minute} = 13 20180522 15:13:53.367 - INFO - ${second} = 53 20180522 15:13:53.367 - INFO - +------ END KW: BuiltIn.Get Time (1) 20180522 15:13:53.367 - INFO - +------ START KW: BuiltIn.Set Variable [ ${year}${month}${day}${hour}${minute}${second} ] 20180522 15:13:53.368 - INFO - ${screenshot_name} = 20180522_151353 20180522 15:13:53.368 - INFO - +------ END KW: BuiltIn.Set Variable (1) 20180522 15:13:53.368 - INFO - +------ START KW: AppiumLibrary.Capture Page Screenshot [ ${screenshot_name}.png ] 20180522 15:13:57.142 - INFO - 20180522 15:13:57.142 - INFO - +------ END KW: AppiumLibrary.Capture Page Screenshot (3774) 20180522 15:13:57.142 - INFO - +------ START KW: AppiumLibrary.Log Source [ ] 20180522 15:13:57.365 - FAIL - WebDriverException: Message: An unknown server-side error occurred while processing the command. 20180522 15:13:57.365 - DEBUG - Traceback (most recent call last): File "", line 2, in log_source File "/usr/lib/python2.7/site-packages/AppiumLibrary/keywords/keywordgroup.py", line 20, in _run_on_failure_decorator raise err 20180522 15:13:57.365 - INFO - +------ END KW: AppiumLibrary.Log Source (223) 20180522 15:13:57.365 - INFO - +----- END KW: 02-MDL-KEYWORDS.Capture Page Screenshot With Context (4004) 20180522 15:13:57.365 - WARN - Keyword 'Capture Page Screenshot With Context' could not be run on failure: WebDriverException: Message: An unknown server-side error occurred while processing the command. 20180522 15:13:57.366 - FAIL - WebDriverException: Message: An unknown server-side error occurred while processing the command. 20180522 15:13:57.366 - DEBUG - Traceback (most recent call last): File "", line 2, in wait_until_page_contains File "/usr/lib/python2.7/site-packages/AppiumLibrary/keywords/keywordgroup.py", line 20, in _run_on_failure_decorator raise err 20180522 15:13:57.366 - INFO - +---- END KW: AppiumLibrary.Wait Until Page Contains (8678)

serhatbolsu commented 5 years ago

Can you try the same scenario with appium-python-client ?

serhatbolsu commented 2 years ago

Closing due to inactivity