Skip to content

Win 10 Ie11 : Unable to set/get window size upgrading from IEDriver 3.4 to IEDriver 3.6 #4937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
andreabisello opened this issue Oct 24, 2017 · 6 comments
Labels
C-py Python Bindings D-IE

Comments

@andreabisello
Copy link

On
Windows 10 64 bit full stack updated
With
Selenium 3.6
IEDriver 3.6

this

from selenium import webdriver
browser = webdriver.Ie()
browser.set_window_size(1300, 1000)

will not change window size and this

print(browser.get_window_size())

returns

{'message': 'Command not found: GET /session/cca537b7-5bc0-49ee-972e-400d9cf1ddb5/window/size', 'value': None, 'error': 'unknown method'}

On Chrome set_window_size works and get_window_size returns the right dimension.

This is a regression , because with IEDriver 3.4, it works without error also on IE11.

@pekkaklarck
Copy link

Somewhat related to this, is there a reason Selenium doesn't raise an exception when a driver returns such an error? Browsing through the code it seems that an error should be raised by ErrorHandler.check_response() which ought to be called by WebDriver.execute() that WebDriver.get_window_size() ought to call. Based on the above description, it seems no error is raised and invalid data is simply returned to the user.

@barancev barancev added the D-IE label Oct 24, 2017
@p0deje
Copy link
Member

p0deje commented Oct 25, 2017

It looks like Python bindings implement incorrect commands for getting/setting window size:

            Command.W3C_GET_WINDOW_SIZE:
                ('GET', '/session/$sessionId/window/size'),
            Command.W3C_SET_WINDOW_SIZE:
                ('POST', '/session/$sessionId/window/size'),

No such commands are defined by specification, so bindings should instead fallback to rect commands. Just like Ruby bindings do.

@p0deje p0deje added the C-py Python Bindings label Oct 25, 2017
@p0deje
Copy link
Member

p0deje commented Oct 25, 2017

@pekkaklarck Interesting, can you please raise a separate issue for that?

@pekkaklarck
Copy link

@p0deje Done. See #4948.

@lmtierney
Copy link
Member

Fixed in ffce538, will be in the next release. I'll look at the other issue you added

@andreabisello
Copy link
Author

with version 3.8 getter and setter works.

C:\Python27\python.exe C:/src/python_selenium/set_window_size.py
{'width': 1936, 'height': 1056}

image

@lock lock bot locked and limited conversation to collaborators Aug 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
C-py Python Bindings D-IE
Projects
None yet
Development

No branches or pull requests

5 participants