I am trying to check a webpage with Selenium. My code is below.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
driver = webdriver.Firefox()
driver.get("http://www.python.org")
assert "Python" in driver.title
elem = driver.find_element_by_name("q")
elem.send_keys("selenium")
elem.send_keys(Keys.RETURN)
driver.close()
When I run the above code, a Firefox browser window appears, as expected. However, the window margins are very small (see the figure below). So small that the leftmost tab launches into the window's zoom button. This size issue does not occur when I use Chrome WebDriver. Has anyone asked this question? Has anyone found out how to solve this problem?
Here is my mini stack:
- selenium 2.42.1 (installed via pip)
- python 2.7.6
- firefox 29.0.1
- Mac OSX 10.9.3

source
share