Automation error in Selenium: Failed to change window status to 'normal'

Asked

Viewed 30 times

0

When trying to execute a code using the Selenium library, I get the following error:

<html><head></head><body></body></html>
 Traceback (most recent call last):
 File "webdriver.py", line 23, in <module>
 driver.set_window_size(1234, 773)
 File "/home/lucas/.local/lib/python2.7/sitepackages/selenium/webdriver/remote/webdriver.py", line 1090, in set_window_size self.set_window_rect(width=int(width), height=int(height))File"/home/lucas/.local/lib/python2.7/site-packages/selenium/webdriver/remote/webdriver.py", line 1182, in set_window_rect"height": height})['value']
 File "/home/lucas/.local/lib/python2.7/site packages/selenium/webdriver/remote/webdriver.py", line 321, in execute self.error_handler.check_response(response)
 File "/home/lucas/.local/lib/python2.7/site-packages/selenium/webdriver/remote/errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.WebDriverException: Message: unknown error: failed to change window state to 'normal', current state is 'maximized'
(Session info: chrome=88.0.4324.182)

Chunk of code I’m running:

inserir a descrição da imagem aqui

driver = webdriver.Chrome()
print driver.page_source.encode('utf-8')
num_pep = 0

while num_pep <= 2211:
   num_pep = str(num_pep)
   # Test name: docking
   # Step # | name | target | value | comment
   # 1 | open | /hpepdock/ |  | 
   driver.get("http://huanglab.phys.hust.edu.cn/hpepdock/")
   # 2 | setWindowSize | 1234x773 |  | 
   driver.set_window_size(1234, 773)
  • tried to set the window size just below instantiating the driver? Ie below driver = webdriver.Chrome() place driver.set_window_size(1234, 773) ?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.