140 likes | 285 Views
FitNesse + WATIJ = WitNesse (Or is it FATIJ). Paul Lamb Vik Anantha. Summary. Browser simulation vs Browser automation (why we chose WATIJ) Testing by programmers vs Testing by business analysts (why we chose FitNesse) The happy co-incidence (putting them both together).
E N D
FitNesse + WATIJ = WitNesse(Or is it FATIJ) Paul Lamb Vik Anantha
Summary • Browser simulation vs Browser automation • (why we chose WATIJ) • Testing by programmers vs Testing by business analysts • (why we chose FitNesse) • The happy co-incidence • (putting them both together)
HttpUnit • com.meterware.httpunit.WebConversation simulates a browser. • maintains session context via cookies returned by the server. WebConversation wc = new WebConversation(); WebResponse resp = wc.getResponse("http://google.com" ); WebForm form = resp.getFormWithName("f"); form.setParameter("q", "httpunit"); resp = form.submit();
HttpUnit • Package com.meterware.httpunit.parsing contains classes to control HTML parsing. • Does it emulate the same type of parsing that IE Supports? • com.meterware.httpunit.scripting contains classes to evaluate javascript. • Does it evaluate javascript the way IE does? • “JavaScript support is very basic at present. The near-term goal is full JavaScript 1.1 support.”
WATIJ(Web Application Testing in Java) • watij.ie automates a browser • Creates new instance of IE or attaches to an instance IE ie = new IE(); ie.start("http://google.com"); ie.textField(name,"q").set("Watij"); ie.button("Google Search").click();
Other Browser Automation tools • WATIR (wtr.rubyforge.org) • Ruby based • SAMIE (samie.sourceforge.net) • Perl based • PAMIE (pamie.sourceforge.net) • Python • Selenium (www.openqa.org/selenium) • Is it really Browser automation?
FitNesse (Tests) • Tests are expressed as wiki tables of input data and expected output data • Written by non programmers
FitNesse (Fixtures) • Enables System Under Test to be testable by wiki table based tests. • Written by programmers public class Division extends ColumnFixture { public double numerator, denominator; public double quotient() { return numerator/denominator; } }
Sweet Spot • Lets non programmers write automated tests. • Allows tests to be written directly against the relevant business logic code. • Provides a modular structure for organizing test cases. • Fixtures provide a way of defining a testable “unit”.
WitNesse • Is a WATIJ Fixture for FitNesse • Allows WATIJ tests to be written with wiki tables.