Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8494823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:24:12+00:00 2026-06-10T23:24:12+00:00

I am getting this error with Django RuntimeError: Failed to shutdown the live test

  • 0

I am getting this error with Django

RuntimeError: Failed to shutdown the live test server in 2 seconds. The server might be stuck or generating a slow response.

I am trying to run a simple test on a menu on my website. The menu is in an accordion style (scroll down to Example under the overview menu. An accordion is the thing in the Demo, where menus appear and disappear according to how you click them: http://docs.jquery.com/UI/Accordion#overview)

When one of the menus open, a text box for searching is present. What I’m trying to do is to press that button, then enter some values and click ‘Enter’ to go see the search results.

CODE

from django.test import LiveServerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
import time

class SeleniumTests(LiveServerTestCase):
    fixtures = ['testData.json',]

    @classmethod
    def setUpClass(cls):
        cls.driver = WebDriver()
        super(SeleniumTests, cls).setUpClass()

    @classmethod
    def tearDownClass(cls):
        super(SeleniumTests, cls).tearDownClass()
        cls.driver.quit()

    def test_example(self):

        #load the site 
        self.driver.get('%s%s' % (self.live_server_url, '/testingDB/'))
        #find the accordion button
        elem1 = self.driver.find_element_by_id("search_button")
        #click it
        elem1.click()

        #wait a little bit so the accordion loads 
        self.driver.implicitly_wait(5)
        #could've also used this command ->time.sleep(1)

        #find the element that now appeared
        elem = self.driver.find_element_by_name("q")
        #enter the search query and press enter 
        elem.send_keys("selenium" + Keys.RETURN)
        #assert that a new page loaded, with Search in the title
        assert "Search" in self.driver.title

The test works great, but Django gives me the error. If I shorten the time too much, then selenium won’t be able to find the search box, and it claims

Element is not currently visible and so may not be interacted with

I don’t know how to avoid the live test server error. (Django information obtained from https://docs.djangoproject.com/en/dev/topics/testing/#django.test.LiveServerTestCase )

Additional Information

This is the menu:

Part 1

enter image description here

Then click ‘Search’ and the below appears in about 0.5 seconds.

Part 2
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T23:24:14+00:00Added an answer on June 10, 2026 at 11:24 pm

    The error you are seeing is associated with the clean-up code found in SeleniumTests.tearDownClass(cls). Within that method, if you call cls.driver.quit() before you call super(SeleniumTests, cls).tearDownClass() the error will go away.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this weird error in my development server when running my django
I keep getting this error when using django templates in Google App Engine: TemplateSyntaxError:
Getting this error with jquery & jquery.form. Site has been live for awhile..upgraded to
I am getting this error in Django: UnicodeDecodeError at /category/list/ 'utf8' codec can't decode
While using django.core.paginator import ObjectPaginator, I'm getting this error: NeedIndexError: The built-in indices are
I'm getting this error Traceback (most recent call last): File /home/<username>/flup/server/fcgi_base.py, line 558, in
i am learning django from official django tutorial. and i am getting this error
I keep getting this error when I go to the development server that the
I'm getting this error django.db.utils.IntegrityError: django_content_type.name may not be NULL while running tests via
Django 1.1.2 & Python 2.6.5 I keep getting this error when executing a seemingly

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.