Question

Here is my TestCase:

class AdminTest(LiveServerTestCase):

  def setUp(self):
      self.browser = webdriver.Firefox()
      self.browser.set_window_size(1920, 1080)

  def tearDown(self):
      pass
      #self.browser.quit()

  def test_admin_site(self):    
      # user opens web browser, navigates to admin page
      self.browser.get(self.live_server_url + '/admin/')
      body = self.browser.find_element_by_tag_name('body')
      self.assertIn('Django administration', body.text)

I find that the body of the content in HTML is very small. I tried maximizing the firefox by setting window_size, but that only increased the overall size. Here is the screenshot from selenium enter image description here

Here is the screenshot from running: python manage.py test my_app/ enter image description here

Was it helpful?

Solution

What version of selenium are you using? I am currently using selenium==2.39.0 and do not have the issue. A colleague of mine reported the same issue as you when running selenium==2.41.0 and downgrading to the same version as me fixed the issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top