[Answered ]-Selenium and Django: how to mock the server?

1👍

Can you not run Selenium over django dev server http://localhost:8000/ .

If not perhaps worth looking at http://harry.pythonanywhere.com/ .where there are some good resources

1👍

The best thing is to integrate selenium tests into your unit test suite. When Django 1.4 comes out this will be a supported feature, where the Django test runner will run a development HTTP server for you while the tests run, and load all of your test fixtures for you:

support-for-in-browser-testing-frameworks
LiveServerTestCase

Likely you can’t wait until the 1.4 release. In the meantime, you can use something called django-nose-selenium to do this:
https://github.com/weluse/django-nose-selenium
There’s a good comprehensive guide on how to do this here:
http://timescapers.com/2011/08/27/django-nose-selenium-a-concise-tutorial/

0👍

If I may plug-plug my own tutorial, which will allow you to do full selenium testing against the django test server

http://www.tdd-django-tutorial.com/

👤hwjp

Leave a comment