I'm trying to create a cross-browser Python-Selenium test script. So I need all results to be same no matter which webdriver (Chrome or IE) I use. I can set browser window size as follow:
driver.set_window_size(1920, 1080) But following code will return different values for Chrome and IE:
element = driver.find_element_by_xpath('some_xpath') element.location as viewport area (where web-content displayed) sizes are different (Chrome- 1910x998, IE- 1904x965) despite of same window size. To get these values I used
driver.execute_script('return document.documentElement.clientHeight') driver.execute_script('return document.documentElement.clientWidth') so I tried
driver.execute_script('document.documentElement.clientHeight = "990px";') driver.execute_script('document.documentElement.clientWeight = "1900px";') but with no luck
So the question is how to set browser viewport size in selenium?