Bug 51525 - ucs-test: Use selenium from debian buster
ucs-test: Use selenium from debian buster
Status: RESOLVED FIXED
Product: UCS Test
Classification: Unclassified
Component: UMC
unspecified
Other Linux
: P5 normal (vote)
: UCS 5.0
Assigned To: Florian Best
Johannes Keiser
:
Depends on: 44718
Blocks:
  Show dependency treegraph
 
Reported: 2020-06-18 16:01 CEST by Florian Best
Modified: 2020-09-17 12:54 CEST (History)
0 users

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Screenshot (36.42 KB, image/png)
2020-06-27 18:17 CEST, Florian Best
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2020-06-18 16:01:47 CEST
ucs-test currently uses pip install selenium==3.6.0 because in stretch no debian package exists.

In debian buster python-selenium 3.14.1+dfsg1-1 exists.
We should use this instead.
Comment 1 Florian Best univentionstaff 2020-06-26 09:09:50 CEST
The tests are failing with the exception:

Traceback (most recent call last):
File "12_product_test_ucr", line 214, in <module>
     with f as ucr_variable_file, selenium.UMCSeleniumTest() as s:
   File "/usr/lib/python2.7/dist-packages/univention/testing/selenium/base.py", line 123, in __enter__
     self.driver.execute_script('document.cookie = "UMCLang=%s; path=/univention/"' % (self.language,))
   File "/usr/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 636, in execute_script
     'args': converted_args})['value']
   File "/usr/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 321, in execute
     self.error_handler.check_response(response)
   File "/usr/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response
     raise exception_class(message, screen, stacktrace)
 selenium.common.exceptions.WebDriverException: Message: <unknown>: Failed to set the 'cookie' property on 'Document': Access is denied for this document.
   (Session info: chrome=80.0.3987.162)

I will try to try-except this, I hope the the language is then set nevertheless.
Comment 2 Florian Best univentionstaff 2020-06-26 09:11:10 CEST
We could instead fix Bug #44718
Comment 3 Florian Best univentionstaff 2020-06-27 18:17:02 CEST
Created attachment 10406 [details]
Screenshot

The tests now fail with the above screenshot: Chromium doesn't accept the self-signed certificate anymore.
Comment 4 Florian Best univentionstaff 2020-08-20 08:24:48 CEST
The Tests now use Selenium from debian buster and are in general working again.

ucs-test (10.0.0-20)
| Bug #51525: open traceback panes
| Bug #51525: selenium+chrome: ignore unknown certificates
| Bug #51525: try to workaround selenium change?
| Bug #51525: try to workaround chromium bug
| Bug #51525: replace pip selenium with python-selenium

univention-appcenter (9.0.0-4)
| Bug #51525: replace pip selenium with python-selenium
Comment 5 Florian Best univentionstaff 2020-09-17 12:54:53 CEST
Johannes noticed also this traceback with Python 2 only:

Traceback (most recent call last):
  File "134_side_menu", line 33, in <module>
    with selenium.UMCSeleniumTest() as s:
  File "/usr/lib/python2.7/dist-packages/univention/testing/selenium/base.py", line 108, in __enter__
    self.driver = webdriver.Chrome(chrome_options=chrome_options)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/chrome/webdriver.py", line 69, in __init__                                                                                                       
    desired_capabilities=desired_capabilities)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 151, in __init__                                                                                                      
    self.start_session(desired_capabilities, browser_profile)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 240, in start_session                                                                                                 
    response = self.execute(Command.NEW_SESSION, parameters)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 308, in execute                                                                                                       
    self.error_handler.check_response(response)
  File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response                                                                                             
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: unknown error: Chrome failed to start: exited abnormally.                                                                                                  
  (unknown error: DevToolsActivePort file doesn't exist)
  (The process started from chrome location /usr/bin/chromium is no longer running, so ChromeDriver is assuming that Chrome has crashed.)