Alex Rivera | Logout

Integration Testing for a Web App

Asked 2009-11-17T09:59:30.213
10

I want to do full integration testing for a web application. I want to test many things like AJAX, positioning and presence of certain phrases and HTML elements using several browsers. I'm seeking a tool to do such automated testing.

On the other hand; this is my first time using integration testing. Are there any specific recommendations when doing such testing? Any tutorial as well?

(As a note: My backend code is done using Perl, Python and Django.)

Thanks!

Edit
Report

3 Answers

7

In this article, Noah Gift does a good job presenting three main alternatives for web app integration testing: Windmill, Selenium and Twill. Twill doesn't do Javascript, so that leaves Selenium and Windmill as your main possibilities; Gifts shows enough about what using each of them means, so you can choose.

One thing Gift doesn't mention is that Selenium is much more popular -- that's not obvious if you just web search each of the terms windmill and selenium, but that's because each gets (different numbers of;-) false hits. [windmill javascript] gives 325k hits, [selenium javascript] gives 1.2M hits, and this ratio is more representative. Anyway, the point is that, if you find them both equally easy and powerful enough for your needs, so that you have a hard time choosing one, then picking selenium (i.e., going with the crowd) may have advantages (more experts around, e.g. on SO to answer questions;-) wrt picking the somewhat less popular alternative.

answered 2009-11-17T15:42:45.487
4

You can also control selenium using Selenium-RC's python binding. For example:

from selenium import selenium
selenium = selenium("localhost", 4444, "*firefox",
            "http://www.google.com/")
selenium.start()
selenium.open("/") # open google.com
selenium.type("q", "selenium rc")
selenium.click("btnG")
selenium.wait_for_page_to_load("30000")
selenium.failUnless(selenium.is_text_present("Results * for selenium rc"))
selenium.stop()
answered 2009-11-17T11:05:36.463
1

TestPlan is a great tool for general purpose web testing. It provides both a display-less backend and Selenium. The Selenium backend should take care of testing in all the popular browsers. It also has its own scripting language which makes it quick to write and test, though Java can also be used.

For example, this goes to a page and submits a search form and checks that it found the correct result.

GotoURL http://myapp.com/

SubmitForm with
  %Params:search% some term
end

Check //div[@id='results'][contains(text(),'some term']
answered 2009-12-11T14:56:59.040

Your Answer