Timeout error. When running a script on a Chrome browser without a chronometer using Selenium Webdriver with Python

When I run python scripts to test the website in Chromeless Broswer Headless (Webdriver + Selenium ), we often get a timeout error, I found that the problem occurred when the script interacted with the browser using the .click()or methods .send_keys(). Can anyone know what the problem is? Sometimes it works fine, but sometimes I have a timeout error. Please give a solution for the same

Stack trace:

 15:01:48,194 root:ERROR: ERROR occurred: Message: timeout
   (Session info: headless chrome=60.0.3112.101)
   (Driver info: chromedriver=2.31.488763 
   (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.1.7601 SP1 
    x86)

    Traceback (most recent call last):
  File "c:\autotest\x.py", line 148, in main
    func(nik)
  File "c:\autotest\lib\support.py", line 126, in wrapper
    raise ret
  File "c:\autotest\lib\support.py", line 113, in newFunc
    res[0] = func(*args, **kwargs)
  File "c:\autotest\testcases\1001.py", line 15, in testcase
    "documents_approved ASC", generateError=True)  
  File "c:\autotest\lib\support.py", line 51, in wrapper
    f_result = func(*args, **kwds)
  File "c:\autotest\pageobjects\web\segment_header.py", line 184, in login
    + Keys.ENTER)
  File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 350, in send_keys
    'value': keys_to_typing(value)})
  File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webelement.py", line 499, in _execute
    return self._parent.execute(command, params)
  File "C:\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 297, in execute
    self.error_handler.check_response(response)
  File "C:\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: timeout
  (Session info: headless chrome=60.0.3112.101)
  (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.1.7601 SP1 
    x86) 
+4
source share
1 answer

, Chrome , .

, - :

driver.set_window_size(1200, 600)

.

, !

+1

Source: https://habr.com/ru/post/1684124/


All Articles