Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is Firefox's url address bar so small when Firefox is opened by Selenium?

I am trying to test 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 pops up as expected. However, the size of the window's fields are very small (see picture below). So small that the left most tab runs into the window's zoom button. This sizing issue does not occur when I use the Chrome WebDriver. Has anyone had this sizing issue? Any has anyone found out how to solve this issue?

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

picture

like image 257
Paul Avatar asked Mar 20 '23 09:03

Paul


1 Answers

This is the issue with the latest selenium package version:

  • Selenium launches FF with tiny font on OSX Macbook

As a workaround, downgrade selenium to 2.40.0 version:

pip install selenium==2.40.0
like image 197
alecxe Avatar answered Apr 06 '23 15:04

alecxe