KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > jwebunit > sample > JWebUnitSearchExample


1 package net.sourceforge.jwebunit.sample;
2
3 import net.sourceforge.jwebunit.WebTestCase;
4
5 /**
6  * Google search test with jWebUnit.
7  *
8  * @author Jim Weaver
9  */

10 public class JWebUnitSearchExample extends WebTestCase {
11
12     public JWebUnitSearchExample(String JavaDoc name) {
13         super(name);
14     }
15
16     public void setUp() {
17         getTestContext().setBaseUrl("http://www.google.com");
18     }
19
20     public void testSearch() {
21         beginAt("/");
22         setFormElement("q", "httpunit");
23         submit("btnG");
24         clickLinkWithText("HttpUnit");
25         assertTitleEquals("HttpUnit");
26         assertLinkPresentWithText("User's Manual");
27     }
28 }
Popular Tags