View Javadoc

1   /**
2    * Copyright (c) 2002-2015, JWebUnit team.
3    *
4    * This file is part of JWebUnit.
5    *
6    * JWebUnit is free software: you can redistribute it and/or modify
7    * it under the terms of the GNU Lesser General Public License as published by
8    * the Free Software Foundation, either version 3 of the License, or
9    * (at your option) any later version.
10   *
11   * JWebUnit is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.
15   *
16   * You should have received a copy of the GNU Lesser General Public License
17   * along with JWebUnit.  If not, see <http://www.gnu.org/licenses/>.
18   */
19  package net.sourceforge.jwebunit.junit;
20  
21  import java.awt.Image;
22  import java.io.File;
23  import java.io.PrintStream;
24  import java.util.List;
25  import java.util.Map;
26  import java.net.URL;
27  
28  import net.sourceforge.jwebunit.api.HttpHeader;
29  import net.sourceforge.jwebunit.api.IElement;
30  import net.sourceforge.jwebunit.api.ITestingEngine;
31  import net.sourceforge.jwebunit.exception.TestingEngineResponseException;
32  import net.sourceforge.jwebunit.html.Table;
33  import net.sourceforge.jwebunit.util.TestContext;
34  
35  import junit.framework.TestCase;
36  
37  /**
38   * Deprecated: use JUnit 4 and {@link JWebUnit} instead.
39   * Superclass for JUnit 3 TestCases which provides web application navigation and 
40   * JUnit assertions. This class uses and is generated from {@link net.sourceforge.jwebunit.junit.WebTester}.
41   * 
42   * @author JavaCC
43   */
44  @Deprecated
45  public abstract class WebTestCase extends TestCase {
46      protected WebTester tester = null;
47  
48      protected WebTester customTester = null;
49  
50      /***
51        * From 2.1 you can provide your own WebTester to run test cases.
52        */
53      public WebTestCase(WebTester customTester) {
54          super();
55          this.customTester = customTester;
56      }
57  
58      public WebTestCase(String name, WebTester customTester) {
59          super(name);
60          this.customTester = customTester;
61      }
62  
63      public WebTestCase(String name) {
64          super(name);
65      }
66  
67      public WebTestCase() {
68          super();
69      }
70  
71      protected void tearDown() throws Exception {
72          closeBrowser();
73          super.tearDown();
74      }
75  
76      /**
77       * Get internal WebTester.
78       */
79      public WebTester getTester() {
80          return this.tester;
81      }
82  
83      /**
84       * Clean up unused memory. Using <tt>setUp</tt> and <tt>tearDown</tt> is
85       * not an option for this requires the subclasses of this class to call the
86       * respective <tt>super</tt> methods.
87       *
88       * <p>Original patch contributed by Budi Boentaran.
89       */
90      public void runBare() throws Throwable {
91          try {
92              if (customTester == null)
93                  tester = new WebTester();
94              else
95                  tester = customTester;
96              super.runBare();
97          } finally {
98              tester = null;
99              customTester = null;
100         }
101     }
102 
103     /**
104      * Provides access to the testing engine for subclasses - in case functionality not yet wrappered required by test.
105      *
106      * If the testing engine is not explicitly set the JWebUnit framework will default to using the orignal testing engine,
107      * which is, htmlunit.
108      *
109      * @return IJWebUnitDialog instance used to wrapper htmlunit conversation.
110      * @deprecated You should not use plugin specific functionality. Please ask for a new core feature instead.
111      */
112     public ITestingEngine getDialog() {
113         try {
114             return tester.getDialog();
115         } catch (org.junit.ComparisonFailure e) {
116             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
117         } catch (java.lang.AssertionError e) {
118             throw new junit.framework.AssertionFailedError(e.getMessage());
119         }
120     }
121 
122     /**
123      * Set the base url for the test context.
124      *
125      * @param url Base url value - A trailing "/" is appended if not provided.
126      */
127     public void setBaseUrl(String url) {
128         try {
129             tester.setBaseUrl(url);
130         } catch (org.junit.ComparisonFailure e) {
131             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
132         } catch (java.lang.AssertionError e) {
133             throw new junit.framework.AssertionFailedError(e.getMessage());
134         }
135     }
136 
137     /**
138      * Set the base url for the test context.
139      *
140      * @param url Base url value - A trailing "/" is appended if not provided.
141      */
142     public void setBaseUrl(URL url) {
143         try {
144             tester.setBaseUrl(url);
145         } catch (org.junit.ComparisonFailure e) {
146             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
147         } catch (java.lang.AssertionError e) {
148             throw new junit.framework.AssertionFailedError(e.getMessage());
149         }
150     }
151 
152     /**
153      * Protected version of deprecated getDialog(). Not deprecated for internal use.
154      *
155      * @return IJWebUnitDialog instance.
156      */
157     public ITestingEngine getTestingEngine() {
158         try {
159             return tester.getTestingEngine();
160         } catch (org.junit.ComparisonFailure e) {
161             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
162         } catch (java.lang.AssertionError e) {
163             throw new junit.framework.AssertionFailedError(e.getMessage());
164         }
165     }
166 
167     /**
168      * Close the current conversation.
169      */
170     public void closeBrowser() {
171         try {
172             tester.closeBrowser();
173         } catch (org.junit.ComparisonFailure e) {
174             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
175         } catch (java.lang.AssertionError e) {
176             throw new junit.framework.AssertionFailedError(e.getMessage());
177         }
178     }
179 
180     /**
181      * Close the current window.
182      */
183     public void closeWindow() {
184         try {
185             tester.closeWindow();
186         } catch (org.junit.ComparisonFailure e) {
187             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
188         } catch (java.lang.AssertionError e) {
189             throw new junit.framework.AssertionFailedError(e.getMessage());
190         }
191     }
192 
193     /**
194      * Set the testing engine.
195      *
196      * @param aIJWebUnitDialog Testing engine.
197      */
198     public void setDialog(ITestingEngine aIJWebUnitDialog) {
199         try {
200             tester.setDialog(aIJWebUnitDialog);
201         } catch (org.junit.ComparisonFailure e) {
202             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
203         } catch (java.lang.AssertionError e) {
204             throw new junit.framework.AssertionFailedError(e.getMessage());
205         }
206     }
207 
208     /**
209      * Provide access to test testContext.
210      *
211      * @return TestContext
212      */
213     public TestContext getTestContext() {
214         try {
215             return tester.getTestContext();
216         } catch (org.junit.ComparisonFailure e) {
217             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
218         } catch (java.lang.AssertionError e) {
219             throw new junit.framework.AssertionFailedError(e.getMessage());
220         }
221     }
222 
223     /**
224      * Allows setting an external test testContext class that might be extended from TestContext. Example:
225      * setTestContext(new CompanyATestContext());
226      *
227      * CompanyATestContext extends TestContext.
228      *
229      * @param aTestContext
230      */
231     public void setTestContext(TestContext aTestContext) {
232         try {
233             tester.setTestContext(aTestContext);
234         } catch (org.junit.ComparisonFailure e) {
235             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
236         } catch (java.lang.AssertionError e) {
237             throw new junit.framework.AssertionFailedError(e.getMessage());
238         }
239     }
240 
241     /**
242      * Begin conversation at a URL absolute or relative to base URL. Use
243      * {@link TestContext#setBaseUrl(String) getTestContext().setBaseUrl(String)} to define base URL. Absolute URL
244      * should start with "http://", "https://" or "www.".
245      *
246      * @param url absolute or relative URL (relative to base URL).
247      * @throws TestingEngineResponseException If something bad happend (404)
248      */
249     public void beginAt(String aRelativeURL)throws TestingEngineResponseException {
250         try {
251             tester.beginAt(aRelativeURL);
252         } catch (org.junit.ComparisonFailure e) {
253             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
254         } catch (java.lang.AssertionError e) {
255             throw new junit.framework.AssertionFailedError(e.getMessage());
256         }
257     }
258 
259     /**
260      * Return the value of a web resource based on its key. This translates to a property file lookup with the locale
261      * based on the current TestContext.
262      *
263      * @param key name of the web resource.
264      * @return value of the web resource, encoded according to TestContext.
265      */
266     public String getMessage(String key) {
267         try {
268             return tester.getMessage(key);
269         } catch (org.junit.ComparisonFailure e) {
270             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
271         } catch (java.lang.AssertionError e) {
272             throw new junit.framework.AssertionFailedError(e.getMessage());
273         }
274     }
275 
276     /**
277      * Return the value of a web resource based on its key, using MessageFormat
278      * to perform parametric substitution with formatting.
279      *
280      * @see MessageFormat
281      * @param key
282      *            name of the web resource.
283      * @param args
284      *            array of arguments to be formatted into message
285      * @return value of the web resource after formatting
286      */
287     public String getMessage(String key, Object[] args) {
288         try {
289             return tester.getMessage(key, args);
290         } catch (org.junit.ComparisonFailure e) {
291             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
292         } catch (java.lang.AssertionError e) {
293             throw new junit.framework.AssertionFailedError(e.getMessage());
294         }
295     }
296 
297     /**
298      * Assert that the page response has a particular code.
299      *
300      * @param status the expected status code
301      */
302     public void assertResponseCode(int status) {
303         try {
304             tester.assertResponseCode(status);
305         } catch (org.junit.ComparisonFailure e) {
306             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
307         } catch (java.lang.AssertionError e) {
308             throw new junit.framework.AssertionFailedError(e.getMessage());
309         }
310     }
311 
312     /**
313      * Assert that the page response has a particular code between lower and higher
314      * (<code>lower <= status <= higher</code>).
315      *
316      * @param lower the lower bound for the expected status code
317      * @param higher the upper bound for the expected status code
318      */
319     public void assertResponseCodeBetween(int lower, int higher) {
320         try {
321             tester.assertResponseCodeBetween(lower, higher);
322         } catch (org.junit.ComparisonFailure e) {
323             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
324         } catch (java.lang.AssertionError e) {
325             throw new junit.framework.AssertionFailedError(e.getMessage());
326         }
327     }
328 
329     /**
330    * Should the tester ignore failing status codes (300+)? Otherwise,
331    * failing status codes will throw an exception.
332    *
333    * @param ignore
334    */
335     public void setIgnoreFailingStatusCodes(boolean ignore) {
336         try {
337             tester.setIgnoreFailingStatusCodes(ignore);
338         } catch (org.junit.ComparisonFailure e) {
339             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
340         } catch (java.lang.AssertionError e) {
341             throw new junit.framework.AssertionFailedError(e.getMessage());
342         }
343     }
344 
345     /**
346      * Assert a header is present.
347      *
348      * @param name The header to find
349      */
350     public void assertHeaderPresent(String name) {
351         try {
352             tester.assertHeaderPresent(name);
353         } catch (org.junit.ComparisonFailure e) {
354             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
355         } catch (java.lang.AssertionError e) {
356             throw new junit.framework.AssertionFailedError(e.getMessage());
357         }
358     }
359 
360     /**
361      * Assert a header is NOT present.
362      *
363      * @param name The header to find
364      */
365     public void assertHeaderNotPresent(String name) {
366         try {
367             tester.assertHeaderNotPresent(name);
368         } catch (org.junit.ComparisonFailure e) {
369             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
370         } catch (java.lang.AssertionError e) {
371             throw new junit.framework.AssertionFailedError(e.getMessage());
372         }
373     }
374 
375     /**
376      * Assert a header is equal to a particular value.
377      *
378      * @param name Header to find
379      * @param value Value to compare against
380      */
381     public void assertHeaderEquals(String name, String value) {
382         try {
383             tester.assertHeaderEquals(name, value);
384         } catch (org.junit.ComparisonFailure e) {
385             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
386         } catch (java.lang.AssertionError e) {
387             throw new junit.framework.AssertionFailedError(e.getMessage());
388         }
389     }
390 
391     /**
392      * Assert a header matches a particular pattern.
393      *
394      * @param name Header to find
395      * @param regexp Pattern to compare against
396      */
397     public void assertHeaderMatches(String name, String regexp) {
398         try {
399             tester.assertHeaderMatches(name, regexp);
400         } catch (org.junit.ComparisonFailure e) {
401             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
402         } catch (java.lang.AssertionError e) {
403             throw new junit.framework.AssertionFailedError(e.getMessage());
404         }
405     }
406 
407     /**
408      * Get a particular header value.
409      *
410      * @param name Header to find
411      * @return The found header value, or null
412      */
413     public String getHeader(String name) {
414         try {
415             return tester.getHeader(name);
416         } catch (org.junit.ComparisonFailure e) {
417             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
418         } catch (java.lang.AssertionError e) {
419             throw new junit.framework.AssertionFailedError(e.getMessage());
420         }
421     }
422 
423     /**
424      * Get all response headers.
425      *
426      * @return A map of response headers
427      * @deprecated This method do not deal with several headers with same name. Use {@link #getResponseHeaders()} instead.
428      */
429     @Deprecated
430     public Map<String,String> getAllHeaders() {
431         try {
432             return tester.getAllHeaders();
433         } catch (org.junit.ComparisonFailure e) {
434             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
435         } catch (java.lang.AssertionError e) {
436             throw new junit.framework.AssertionFailedError(e.getMessage());
437         }
438     }
439 
440     /**
441      * Return all HTTP headers that are in last response. It is possible to have several headers with same name.
442      *
443      * @return A list of {@link HttpHeader} elements.
444      */
445     public List<HttpHeader> getResponseHeaders() {
446         try {
447             return tester.getResponseHeaders();
448         } catch (org.junit.ComparisonFailure e) {
449             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
450         } catch (java.lang.AssertionError e) {
451             throw new junit.framework.AssertionFailedError(e.getMessage());
452         }
453     }
454 
455     /**
456      * Assert title of current html page in conversation matches an expected
457      * value.
458      *
459      * @param title
460      *            expected title value
461      */
462     public void assertTitleEquals(String title) {
463         try {
464             tester.assertTitleEquals(title);
465         } catch (org.junit.ComparisonFailure e) {
466             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
467         } catch (java.lang.AssertionError e) {
468             throw new junit.framework.AssertionFailedError(e.getMessage());
469         }
470     }
471 
472     /**
473      * Assert title of current html page in conversation is not
474      * equal to another value.
475      *
476      * @param title
477      *            unexpected title value
478      * @deprecated Replaced by {@link #assertTitleNotEquals(String)}
479      */
480     @Deprecated
481     public void assertTitleNotSame(String title) {
482         try {
483             tester.assertTitleNotSame(title);
484         } catch (org.junit.ComparisonFailure e) {
485             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
486         } catch (java.lang.AssertionError e) {
487             throw new junit.framework.AssertionFailedError(e.getMessage());
488         }
489     }
490 
491     /**
492      * Assert title of current html page in conversation is not
493      * equal to another value.
494      *
495      * @param title
496      *            unexpected title value
497      */
498     public void assertTitleNotEquals(String title) {
499         try {
500             tester.assertTitleNotEquals(title);
501         } catch (org.junit.ComparisonFailure e) {
502             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
503         } catch (java.lang.AssertionError e) {
504             throw new junit.framework.AssertionFailedError(e.getMessage());
505         }
506     }
507 
508     /**
509      * Assert title of current html page in conversation matches an expected regexp.
510      *
511      * @param regexp expected title regexp
512      */
513     public void assertTitleMatch(String regexp) {
514         try {
515             tester.assertTitleMatch(regexp);
516         } catch (org.junit.ComparisonFailure e) {
517             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
518         } catch (java.lang.AssertionError e) {
519             throw new junit.framework.AssertionFailedError(e.getMessage());
520         }
521     }
522 
523     /**
524      * Assert title of current html page matches the value of a specified web
525      * resource.
526      *
527      * @param titleKey
528      *            web resource key for title
529      */
530     public void assertTitleEqualsKey(String titleKey) {
531         try {
532             tester.assertTitleEqualsKey(titleKey);
533         } catch (org.junit.ComparisonFailure e) {
534             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
535         } catch (java.lang.AssertionError e) {
536             throw new junit.framework.AssertionFailedError(e.getMessage());
537         }
538     }
539 
540     /**
541      * Assert title of current page matches formatted message resource
542      *
543      * @param titleKey
544      * @param args
545      */
546     public void assertTitleEqualsKey(String titleKey, Object[] args) {
547         try {
548             tester.assertTitleEqualsKey(titleKey, args);
549         } catch (org.junit.ComparisonFailure e) {
550             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
551         } catch (java.lang.AssertionError e) {
552             throw new junit.framework.AssertionFailedError(e.getMessage());
553         }
554     }
555 
556     /**
557      * Assert that a web resource's value is present.
558      *
559      * @param key
560      *            web resource name
561      */
562     public void assertKeyPresent(String key) {
563         try {
564             tester.assertKeyPresent(key);
565         } catch (org.junit.ComparisonFailure e) {
566             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
567         } catch (java.lang.AssertionError e) {
568             throw new junit.framework.AssertionFailedError(e.getMessage());
569         }
570     }
571 
572     /**
573      * Assert that a web resource's value (with formatting) is present
574      *
575      * @param key
576      * @param args
577      */
578     public void assertKeyPresent(String key, Object[] args) {
579         try {
580             tester.assertKeyPresent(key, args);
581         } catch (org.junit.ComparisonFailure e) {
582             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
583         } catch (java.lang.AssertionError e) {
584             throw new junit.framework.AssertionFailedError(e.getMessage());
585         }
586     }
587 
588     /**
589      * Assert that supplied text is present.
590      *
591      * @param text
592      */
593     public void assertTextPresent(String text) {
594         try {
595             tester.assertTextPresent(text);
596         } catch (org.junit.ComparisonFailure e) {
597             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
598         } catch (java.lang.AssertionError e) {
599             throw new junit.framework.AssertionFailedError(e.getMessage());
600         }
601     }
602 
603     /**
604      * Assert that supplied regexp is matched in the text of a page.
605      *
606      * @param regexp
607      */
608     public void assertMatch(String regexp) {
609         try {
610             tester.assertMatch(regexp);
611         } catch (org.junit.ComparisonFailure e) {
612             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
613         } catch (java.lang.AssertionError e) {
614             throw new junit.framework.AssertionFailedError(e.getMessage());
615         }
616     }
617 
618     /**
619      * Assert a given string matches a given regular expression.
620      *
621      * @param regexp
622      * @param text
623      */
624     public void assertMatch(String regexp, String text) {
625         try {
626             tester.assertMatch(regexp, text);
627         } catch (org.junit.ComparisonFailure e) {
628             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
629         } catch (java.lang.AssertionError e) {
630             throw new junit.framework.AssertionFailedError(e.getMessage());
631         }
632     }
633 
634     /**
635      * Assert a given string does not match a given regular expression.
636      *
637      * @param regexp
638      * @param text
639      */
640     public void assertNotMatch(String regexp, String text) {
641         try {
642             tester.assertNotMatch(regexp, text);
643         } catch (org.junit.ComparisonFailure e) {
644             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
645         } catch (java.lang.AssertionError e) {
646             throw new junit.framework.AssertionFailedError(e.getMessage());
647         }
648     }
649 
650     /**
651      * Assert a given string matches a given regular expression.
652      *
653      * @param regexp
654      * @param text
655      */
656     public void assertMatch(String message, String regexp, String text) {
657         try {
658             tester.assertMatch(message, regexp, text);
659         } catch (org.junit.ComparisonFailure e) {
660             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
661         } catch (java.lang.AssertionError e) {
662             throw new junit.framework.AssertionFailedError(e.getMessage());
663         }
664     }
665 
666     /**
667      * Assert a given string does not match a given regular expression.
668      *
669      * @param regexp
670      * @param text
671      */
672     public void assertNotMatch(String message, String regexp, String text) {
673         try {
674             tester.assertNotMatch(message, regexp, text);
675         } catch (org.junit.ComparisonFailure e) {
676             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
677         } catch (java.lang.AssertionError e) {
678             throw new junit.framework.AssertionFailedError(e.getMessage());
679         }
680     }
681 
682     /**
683      * Assert that a web resource's value is not present.
684      *
685      * @param key web resource name
686      */
687     public void assertKeyNotPresent(String key) {
688         try {
689             tester.assertKeyNotPresent(key);
690         } catch (org.junit.ComparisonFailure e) {
691             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
692         } catch (java.lang.AssertionError e) {
693             throw new junit.framework.AssertionFailedError(e.getMessage());
694         }
695     }
696 
697     /**
698      * Assert that a web resource's formatted value is not present.
699      *
700      * @param key
701      *            web resource name
702      */
703     public void assertKeyNotPresent(String key, Object[] args) {
704         try {
705             tester.assertKeyNotPresent(key, args);
706         } catch (org.junit.ComparisonFailure e) {
707             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
708         } catch (java.lang.AssertionError e) {
709             throw new junit.framework.AssertionFailedError(e.getMessage());
710         }
711     }
712 
713     /**
714      * Assert that supplied text is not present.
715      *
716      * @param text
717      */
718     public void assertTextNotPresent(String text) {
719         try {
720             tester.assertTextNotPresent(text);
721         } catch (org.junit.ComparisonFailure e) {
722             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
723         } catch (java.lang.AssertionError e) {
724             throw new junit.framework.AssertionFailedError(e.getMessage());
725         }
726     }
727 
728     /**
729      * Assert that supplied regexp is not present.
730      *
731      * @param regexp
732      */
733     public void assertNoMatch(String regexp) {
734         try {
735             tester.assertNoMatch(regexp);
736         } catch (org.junit.ComparisonFailure e) {
737             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
738         } catch (java.lang.AssertionError e) {
739             throw new junit.framework.AssertionFailedError(e.getMessage());
740         }
741     }
742 
743     /**
744      *
745      * @param tableSummaryNameOrId
746      * @return Object that represent a html table in a way independent from plugin.
747      */
748     public Table getTable(String tableSummaryNameOrId) {
749         try {
750             return tester.getTable(tableSummaryNameOrId);
751         } catch (org.junit.ComparisonFailure e) {
752             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
753         } catch (java.lang.AssertionError e) {
754             throw new junit.framework.AssertionFailedError(e.getMessage());
755         }
756     }
757 
758     /**
759      * Assert that a table with a given summary or id value is present.
760      *
761      * @param tableSummaryNameOrId summary, name or id attribute value of table
762      */
763     public void assertTablePresent(String tableSummaryNameOrId) {
764         try {
765             tester.assertTablePresent(tableSummaryNameOrId);
766         } catch (org.junit.ComparisonFailure e) {
767             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
768         } catch (java.lang.AssertionError e) {
769             throw new junit.framework.AssertionFailedError(e.getMessage());
770         }
771     }
772 
773     /**
774      * Assert that a table with a given summary or id value is not present.
775      *
776      * @param tableSummaryNameOrId summary, name or id attribute value of table
777      */
778     public void assertTableNotPresent(String tableSummaryNameOrId) {
779         try {
780             tester.assertTableNotPresent(tableSummaryNameOrId);
781         } catch (org.junit.ComparisonFailure e) {
782             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
783         } catch (java.lang.AssertionError e) {
784             throw new junit.framework.AssertionFailedError(e.getMessage());
785         }
786     }
787 
788     /**
789      * Assert that the value of a given web resource is present in a specific table.
790      *
791      * @param tableSummaryOrId summary or id attribute value of table
792      * @param key web resource name
793      */
794     public void assertKeyInTable(String tableSummaryOrId, String key) {
795         try {
796             tester.assertKeyInTable(tableSummaryOrId, key);
797         } catch (org.junit.ComparisonFailure e) {
798             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
799         } catch (java.lang.AssertionError e) {
800             throw new junit.framework.AssertionFailedError(e.getMessage());
801         }
802     }
803 
804     /**
805      * Assert that the value of a given web resource is present in a specific
806      * table.
807      *
808      * @param tableSummaryOrId
809      *            summary or id attribute value of table
810      * @param key
811      *            web resource name
812      */
813     public void assertKeyInTable(String tableSummaryOrId, String key, Object[] args) {
814         try {
815             tester.assertKeyInTable(tableSummaryOrId, key, args);
816         } catch (org.junit.ComparisonFailure e) {
817             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
818         } catch (java.lang.AssertionError e) {
819             throw new junit.framework.AssertionFailedError(e.getMessage());
820         }
821     }
822 
823     /**
824      * Assert that supplied text is present in a specific table.
825      *
826      * @param tableSummaryNameOrId
827      *            summary, name or id attribute value of table
828      * @param text
829      */
830     public void assertTextInTable(String tableSummaryNameOrId, String text) {
831         try {
832             tester.assertTextInTable(tableSummaryNameOrId, text);
833         } catch (org.junit.ComparisonFailure e) {
834             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
835         } catch (java.lang.AssertionError e) {
836             throw new junit.framework.AssertionFailedError(e.getMessage());
837         }
838     }
839 
840     /**
841      * Assert that supplied regexp is matched in a specific table.
842      *
843      * @param tableSummaryNameOrId summary, name or id attribute value of table
844      * @param regexp
845      */
846     public void assertMatchInTable(String tableSummaryNameOrId, String regexp) {
847         try {
848             tester.assertMatchInTable(tableSummaryNameOrId, regexp);
849         } catch (org.junit.ComparisonFailure e) {
850             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
851         } catch (java.lang.AssertionError e) {
852             throw new junit.framework.AssertionFailedError(e.getMessage());
853         }
854     }
855 
856     /**
857      * Assert that the values of a set of web resources are all present in a specific table.
858      *
859      * @param tableSummaryOrId summary, name or id attribute value of table
860      * @param keys Array of web resource names.
861      */
862     public void assertKeysInTable(String tableSummaryOrId, String[] keys) {
863         try {
864             tester.assertKeysInTable(tableSummaryOrId, keys);
865         } catch (org.junit.ComparisonFailure e) {
866             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
867         } catch (java.lang.AssertionError e) {
868             throw new junit.framework.AssertionFailedError(e.getMessage());
869         }
870     }
871 
872     /**
873      * Assert that the values of a set of web resources are all present in a
874      * specific table.
875      *
876      * @param tableSummaryOrId
877      *            summary or id attribute value of table
878      * @param keys
879      *            Array of web resource names.
880      */
881     public void assertKeysInTable(String tableSummaryOrId, String[] keys, Object[][] args) {
882         try {
883             tester.assertKeysInTable(tableSummaryOrId, keys, args);
884         } catch (org.junit.ComparisonFailure e) {
885             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
886         } catch (java.lang.AssertionError e) {
887             throw new junit.framework.AssertionFailedError(e.getMessage());
888         }
889     }
890 
891     /**
892      * Assert that a set of text values are all present in a specific table.
893      *
894      * @param tableSummaryOrId
895      *            summary, name or id attribute value of table
896      * @param text
897      *            Array of expected text values.
898      */
899     public void assertTextInTable(String tableSummaryOrId, String[] text) {
900         try {
901             tester.assertTextInTable(tableSummaryOrId, text);
902         } catch (org.junit.ComparisonFailure e) {
903             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
904         } catch (java.lang.AssertionError e) {
905             throw new junit.framework.AssertionFailedError(e.getMessage());
906         }
907     }
908 
909     /**
910      * Assert that a set of regexp values are all matched in a specific table.
911      *
912      * @param tableSummaryOrId summary, name or id attribute value of table
913      * @param text Array of expected regexps to match.
914      */
915     public void assertMatchInTable(String tableSummaryOrId, String[] regexp) {
916         try {
917             tester.assertMatchInTable(tableSummaryOrId, regexp);
918         } catch (org.junit.ComparisonFailure e) {
919             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
920         } catch (java.lang.AssertionError e) {
921             throw new junit.framework.AssertionFailedError(e.getMessage());
922         }
923     }
924 
925     /**
926      * Assert that the value of a given web resource is not present in a specific table.
927      *
928      * @param tableSummaryOrId summary, name or id attribute value of table
929      * @param key web resource name
930      */
931     public void assertKeyNotInTable(String tableSummaryOrId, String key) {
932         try {
933             tester.assertKeyNotInTable(tableSummaryOrId, key);
934         } catch (org.junit.ComparisonFailure e) {
935             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
936         } catch (java.lang.AssertionError e) {
937             throw new junit.framework.AssertionFailedError(e.getMessage());
938         }
939     }
940 
941     /**
942      * Assert that supplied text is not present in a specific table.
943      *
944      * @param tableSummaryNameOrId summary, name or id attribute value of table
945      * @param text
946      */
947     public void assertTextNotInTable(String tableSummaryNameOrId, String text) {
948         try {
949             tester.assertTextNotInTable(tableSummaryNameOrId, text);
950         } catch (org.junit.ComparisonFailure e) {
951             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
952         } catch (java.lang.AssertionError e) {
953             throw new junit.framework.AssertionFailedError(e.getMessage());
954         }
955     }
956 
957     /**
958      * Assert that none of a set of text values are present in a specific table.
959      *
960      * @param tableSummaryNameOrId summary, name or id attribute value of table
961      * @param text Array of text values
962      */
963     public void assertTextNotInTable(String tableSummaryNameOrId, String[] text) {
964         try {
965             tester.assertTextNotInTable(tableSummaryNameOrId, text);
966         } catch (org.junit.ComparisonFailure e) {
967             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
968         } catch (java.lang.AssertionError e) {
969             throw new junit.framework.AssertionFailedError(e.getMessage());
970         }
971     }
972 
973     /**
974      * Assert that supplied regexp is not present in a specific table.
975      *
976      * @param tableSummaryNameOrId summary, name or id attribute value of table
977      * @param text
978      */
979     public void assertNoMatchInTable(String tableSummaryNameOrId, String regexp) {
980         try {
981             tester.assertNoMatchInTable(tableSummaryNameOrId, regexp);
982         } catch (org.junit.ComparisonFailure e) {
983             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
984         } catch (java.lang.AssertionError e) {
985             throw new junit.framework.AssertionFailedError(e.getMessage());
986         }
987     }
988 
989     /**
990      * Assert that none of a set of regexp values are present in a specific table.
991      *
992      * @param tableSummaryNameOrId summary, name or id attribute value of table
993      * @param text Array of text values
994      */
995     public void assertNoMatchInTable(String tableSummaryNameOrId, String[] regexp) {
996         try {
997             tester.assertNoMatchInTable(tableSummaryNameOrId, regexp);
998         } catch (org.junit.ComparisonFailure e) {
999             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1000         } catch (java.lang.AssertionError e) {
1001             throw new junit.framework.AssertionFailedError(e.getMessage());
1002         }
1003     }
1004 
1005     /**
1006      * Assert that a specific table matches an ExpectedTable.
1007      *
1008      * @param tableSummaryNameOrId summary, name or id attribute value of table
1009      * @param expectedTable represents expected values (colspan supported).
1010      */
1011     public void assertTableEquals(String tableSummaryNameOrId, Table expectedTable) {
1012         try {
1013             tester.assertTableEquals(tableSummaryNameOrId, expectedTable);
1014         } catch (org.junit.ComparisonFailure e) {
1015             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1016         } catch (java.lang.AssertionError e) {
1017             throw new junit.framework.AssertionFailedError(e.getMessage());
1018         }
1019     }
1020 
1021     /**
1022      * Assert that a specific table matches a matrix of supplied text values.
1023      *
1024      * @param tableSummaryNameOrId summary, name or id attribute value of table
1025      * @param expectedCellValues double dimensional array of expected values
1026      */
1027     public void assertTableEquals(String tableSummaryNameOrId, String[][] expectedCellValues) {
1028         try {
1029             tester.assertTableEquals(tableSummaryNameOrId, expectedCellValues);
1030         } catch (org.junit.ComparisonFailure e) {
1031             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1032         } catch (java.lang.AssertionError e) {
1033             throw new junit.framework.AssertionFailedError(e.getMessage());
1034         }
1035     }
1036 
1037     /**
1038      * Assert that a range of rows for a specific table matches a matrix of supplied text values.
1039      *
1040      * @param tableSummaryNameOrId summary, name or id attribute value of table
1041      * @param startRow index of start row for comparison
1042      * @param expectedTable represents expected values (colspan and rowspan supported).
1043      */
1044     public void assertTableRowsEqual(String tableSummaryNameOrId, int startRow, Table expectedTable) {
1045         try {
1046             tester.assertTableRowsEqual(tableSummaryNameOrId, startRow, expectedTable);
1047         } catch (org.junit.ComparisonFailure e) {
1048             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1049         } catch (java.lang.AssertionError e) {
1050             throw new junit.framework.AssertionFailedError(e.getMessage());
1051         }
1052     }
1053 
1054     /**
1055      * Assert that a range of rows for a specific table matches a matrix of supplied text values.
1056      *
1057      * @param tableSummaryNameOrId summary, name or id attribute value of table
1058      * @param startRow index of start row for comparison
1059      * @param expectedTable represents expected values (colspan and rowspan supported).
1060      */
1061     public void assertTableRowsEqual(String tableSummaryNameOrId, int startRow, String[][] expectedTable) {
1062         try {
1063             tester.assertTableRowsEqual(tableSummaryNameOrId, startRow, expectedTable);
1064         } catch (org.junit.ComparisonFailure e) {
1065             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1066         } catch (java.lang.AssertionError e) {
1067             throw new junit.framework.AssertionFailedError(e.getMessage());
1068         }
1069     }
1070 
1071     /**
1072      * Assert that the number of rows for a specific table equals expected value.
1073      *
1074      * @param tableSummaryNameOrId summary, name or id attribute value of table
1075      * @param expectedRowCount expected row count.
1076      */
1077     public void assertTableRowCountEquals(String tableSummaryNameOrId, int expectedRowCount) {
1078         try {
1079             tester.assertTableRowCountEquals(tableSummaryNameOrId, expectedRowCount);
1080         } catch (org.junit.ComparisonFailure e) {
1081             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1082         } catch (java.lang.AssertionError e) {
1083             throw new junit.framework.AssertionFailedError(e.getMessage());
1084         }
1085     }
1086 
1087     /**
1088      * Assert that a specific table matches an ExpectedTable.
1089      *
1090      * @param tableSummaryOrId summary or id attribute value of table
1091      * @param expectedTable represents expected regexps (colspan supported).
1092      */
1093     public void assertTableMatch(String tableSummaryOrId, Table expectedTable) {
1094         try {
1095             tester.assertTableMatch(tableSummaryOrId, expectedTable);
1096         } catch (org.junit.ComparisonFailure e) {
1097             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1098         } catch (java.lang.AssertionError e) {
1099             throw new junit.framework.AssertionFailedError(e.getMessage());
1100         }
1101     }
1102 
1103     /**
1104      * Assert that a specific table matches a matrix of supplied regexps.
1105      *
1106      * @param tableSummaryOrId summary or id attribute value of table
1107      * @param expectedCellValues double dimensional array of expected regexps
1108      */
1109     public void assertTableMatch(String tableSummaryOrId, String[][] expectedCellValues) {
1110         try {
1111             tester.assertTableMatch(tableSummaryOrId, expectedCellValues);
1112         } catch (org.junit.ComparisonFailure e) {
1113             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1114         } catch (java.lang.AssertionError e) {
1115             throw new junit.framework.AssertionFailedError(e.getMessage());
1116         }
1117     }
1118 
1119     /**
1120      * Assert that a range of rows for a specific table matches a matrix of supplied regexps.
1121      *
1122      * @param tableSummaryOrId summary or id attribute value of table
1123      * @param startRow index of start row for comparison
1124      * @param expectedTable represents expected regexps (colspan and rowspan supported).
1125      */
1126     public void assertTableRowsMatch(String tableSummaryOrId, int startRow, Table expectedTable) {
1127         try {
1128             tester.assertTableRowsMatch(tableSummaryOrId, startRow, expectedTable);
1129         } catch (org.junit.ComparisonFailure e) {
1130             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1131         } catch (java.lang.AssertionError e) {
1132             throw new junit.framework.AssertionFailedError(e.getMessage());
1133         }
1134     }
1135 
1136     /**
1137      * Assert that a range of rows for a specific table matches a matrix of supplied regexps.
1138      *
1139      * @param tableSummaryOrId summary or id attribute value of table
1140      * @param startRow index of start row for comparison
1141      * @param expectedTable represents expected regexps (colspan and rowspan not supported).
1142      */
1143     public void assertTableRowsMatch(String tableSummaryOrId, int startRow, String[][] expectedTable) {
1144         try {
1145             tester.assertTableRowsMatch(tableSummaryOrId, startRow, expectedTable);
1146         } catch (org.junit.ComparisonFailure e) {
1147             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1148         } catch (java.lang.AssertionError e) {
1149             throw new junit.framework.AssertionFailedError(e.getMessage());
1150         }
1151     }
1152 
1153     /**
1154      * Assert that a form input element with a given name is present.
1155      *
1156      * @param formElementName
1157      */
1158     public void assertFormElementPresent(String formElementName) {
1159         try {
1160             tester.assertFormElementPresent(formElementName);
1161         } catch (org.junit.ComparisonFailure e) {
1162             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1163         } catch (java.lang.AssertionError e) {
1164             throw new junit.framework.AssertionFailedError(e.getMessage());
1165         }
1166     }
1167 
1168     /**
1169      * Assert that a form input element with a given name is not present.
1170      *
1171      * @param formElementName
1172      */
1173     public void assertFormElementNotPresent(String formElementName) {
1174         try {
1175             tester.assertFormElementNotPresent(formElementName);
1176         } catch (org.junit.ComparisonFailure e) {
1177             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1178         } catch (java.lang.AssertionError e) {
1179             throw new junit.framework.AssertionFailedError(e.getMessage());
1180         }
1181     }
1182 
1183     /**
1184      * Assert that a form checkbox with a given name is present.
1185      *
1186      * @param checkboxName checkbox name.
1187      */
1188     public void assertCheckboxPresent(String checkboxName) {
1189         try {
1190             tester.assertCheckboxPresent(checkboxName);
1191         } catch (org.junit.ComparisonFailure e) {
1192             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1193         } catch (java.lang.AssertionError e) {
1194             throw new junit.framework.AssertionFailedError(e.getMessage());
1195         }
1196     }
1197 
1198     /**
1199      * Assert that a given checkbox is present.
1200      *
1201      * @param checkboxName checkbox name attribut.
1202      * @param checkboxValue checkbox value attribut.
1203      */
1204     public void assertCheckboxPresent(String checkboxName, String checkboxValue) {
1205         try {
1206             tester.assertCheckboxPresent(checkboxName, checkboxValue);
1207         } catch (org.junit.ComparisonFailure e) {
1208             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1209         } catch (java.lang.AssertionError e) {
1210             throw new junit.framework.AssertionFailedError(e.getMessage());
1211         }
1212     }
1213 
1214     /**
1215      * Assert that a form checkbox with a given name is not present.
1216      *
1217      * @param checkboxName checkbox name.
1218      */
1219     public void assertCheckboxNotPresent(String checkboxName) {
1220         try {
1221             tester.assertCheckboxNotPresent(checkboxName);
1222         } catch (org.junit.ComparisonFailure e) {
1223             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1224         } catch (java.lang.AssertionError e) {
1225             throw new junit.framework.AssertionFailedError(e.getMessage());
1226         }
1227     }
1228 
1229     /**
1230      * Assert that a given checkbox is not present.
1231      *
1232      * @param checkboxName checkbox name.
1233      * @param checkboxValue checkbox value attribut.
1234      */
1235     public void assertCheckboxNotPresent(String checkboxName, String checkboxValue) {
1236         try {
1237             tester.assertCheckboxNotPresent(checkboxName, checkboxValue);
1238         } catch (org.junit.ComparisonFailure e) {
1239             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1240         } catch (java.lang.AssertionError e) {
1241             throw new junit.framework.AssertionFailedError(e.getMessage());
1242         }
1243     }
1244 
1245     /**
1246      * Assert that there is a form present.
1247      *
1248      */
1249     public void assertFormPresent() {
1250         try {
1251             tester.assertFormPresent();
1252         } catch (org.junit.ComparisonFailure e) {
1253             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1254         } catch (java.lang.AssertionError e) {
1255             throw new junit.framework.AssertionFailedError(e.getMessage());
1256         }
1257     }
1258 
1259     /**
1260      * Assert that there is a form with the specified name or id present.
1261      *
1262      * @param nameOrID
1263      */
1264     public void assertFormPresent(String nameOrID) {
1265         try {
1266             tester.assertFormPresent(nameOrID);
1267         } catch (org.junit.ComparisonFailure e) {
1268             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1269         } catch (java.lang.AssertionError e) {
1270             throw new junit.framework.AssertionFailedError(e.getMessage());
1271         }
1272     }
1273 
1274     /**
1275      * Assert that there is a form with the specified name or id and the given index present.
1276      *
1277      * @param nameOrID
1278      * @param index The 0-based index, when more than one form with the same name is expected.
1279      */
1280     public void assertFormPresent(String nameOrID, int index) {
1281         try {
1282             tester.assertFormPresent(nameOrID, index);
1283         } catch (org.junit.ComparisonFailure e) {
1284             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1285         } catch (java.lang.AssertionError e) {
1286             throw new junit.framework.AssertionFailedError(e.getMessage());
1287         }
1288     }
1289 
1290     /**
1291      * Assert that there is not a form present.
1292      *
1293      */
1294     public void assertFormNotPresent() {
1295         try {
1296             tester.assertFormNotPresent();
1297         } catch (org.junit.ComparisonFailure e) {
1298             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1299         } catch (java.lang.AssertionError e) {
1300             throw new junit.framework.AssertionFailedError(e.getMessage());
1301         }
1302     }
1303 
1304     /**
1305      * Assert that there is not a form with the specified name or id present.
1306      *
1307      * @param nameOrID
1308      */
1309     public void assertFormNotPresent(String nameOrID) {
1310         try {
1311             tester.assertFormNotPresent(nameOrID);
1312         } catch (org.junit.ComparisonFailure e) {
1313             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1314         } catch (java.lang.AssertionError e) {
1315             throw new junit.framework.AssertionFailedError(e.getMessage());
1316         }
1317     }
1318 
1319     /**
1320      * Assert that a specific form element has an expected value. Can be used to check hidden input.
1321      *
1322      * @param formElementName
1323      * @param expectedValue
1324      * @see #assertTextFieldEquals(String, String)
1325      * @deprecated use an explicit testing method, e.g. {@link #assertTextFieldEquals(String, String)}
1326      */
1327     public void assertFormElementEquals(String formElementName, String expectedValue) {
1328         try {
1329             tester.assertFormElementEquals(formElementName, expectedValue);
1330         } catch (org.junit.ComparisonFailure e) {
1331             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1332         } catch (java.lang.AssertionError e) {
1333             throw new junit.framework.AssertionFailedError(e.getMessage());
1334         }
1335     }
1336 
1337     /**
1338      * Assert that a specific form element matches an expected regexp.
1339      *
1340      * @param formElementName
1341      * @param regexp
1342      */
1343     public void assertFormElementMatch(String formElementName, String regexp) {
1344         try {
1345             tester.assertFormElementMatch(formElementName, regexp);
1346         } catch (org.junit.ComparisonFailure e) {
1347             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1348         } catch (java.lang.AssertionError e) {
1349             throw new junit.framework.AssertionFailedError(e.getMessage());
1350         }
1351     }
1352 
1353     /**
1354      * Assert that a form element had no value / is empty.
1355      *
1356      * @param formElementName
1357      * @see #setTextField(String, String)
1358      * @see #setHiddenField(String, String)
1359      * @deprecated use an explicit testing method, e.g. {@link #setTextField(String, String)} or {@link #setHiddenField(String, String)}
1360      */
1361     public void assertFormElementEmpty(String formElementName) {
1362         try {
1363             tester.assertFormElementEmpty(formElementName);
1364         } catch (org.junit.ComparisonFailure e) {
1365             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1366         } catch (java.lang.AssertionError e) {
1367             throw new junit.framework.AssertionFailedError(e.getMessage());
1368         }
1369     }
1370 
1371     /**
1372      * Assert that an input text element with name <code>formElementName</code> has the <code>expectedValue</code>
1373      * value.
1374      *
1375      * @param formElementName the value of the name attribute of the element
1376      * @param expectedValue the expected value of the given input element
1377      */
1378     public void assertTextFieldEquals(String formElementName, String expectedValue) {
1379         try {
1380             tester.assertTextFieldEquals(formElementName, expectedValue);
1381         } catch (org.junit.ComparisonFailure e) {
1382             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1383         } catch (java.lang.AssertionError e) {
1384             throw new junit.framework.AssertionFailedError(e.getMessage());
1385         }
1386     }
1387 
1388     /**
1389      * Assert that an input hidden element with name <code>formElementName</code> has the <code>expectedValue</code>
1390      * value.
1391      *
1392      * @param formElementName the value of the name attribute of the element
1393      * @param expectedValue the expected value of the given input element
1394      */
1395     public void assertHiddenFieldPresent(String formElementName, String expectedValue) {
1396         try {
1397             tester.assertHiddenFieldPresent(formElementName, expectedValue);
1398         } catch (org.junit.ComparisonFailure e) {
1399             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1400         } catch (java.lang.AssertionError e) {
1401             throw new junit.framework.AssertionFailedError(e.getMessage());
1402         }
1403     }
1404 
1405     /**
1406      * Assert that a specific checkbox is selected.
1407      *
1408      * @param checkBoxName
1409      */
1410     public void assertCheckboxSelected(String checkBoxName) {
1411         try {
1412             tester.assertCheckboxSelected(checkBoxName);
1413         } catch (org.junit.ComparisonFailure e) {
1414             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1415         } catch (java.lang.AssertionError e) {
1416             throw new junit.framework.AssertionFailedError(e.getMessage());
1417         }
1418     }
1419 
1420     /**
1421      * Assert that a specific checkbox is selected.
1422      *
1423      * @param checkBoxName
1424      * @param checkBoxValue
1425      */
1426     public void assertCheckboxSelected(String checkBoxName, String checkBoxValue) {
1427         try {
1428             tester.assertCheckboxSelected(checkBoxName, checkBoxValue);
1429         } catch (org.junit.ComparisonFailure e) {
1430             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1431         } catch (java.lang.AssertionError e) {
1432             throw new junit.framework.AssertionFailedError(e.getMessage());
1433         }
1434     }
1435 
1436     /**
1437      * Assert that a specific checkbox is not selected.
1438      *
1439      * @param checkBoxName
1440      */
1441     public void assertCheckboxNotSelected(String checkBoxName) {
1442         try {
1443             tester.assertCheckboxNotSelected(checkBoxName);
1444         } catch (org.junit.ComparisonFailure e) {
1445             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1446         } catch (java.lang.AssertionError e) {
1447             throw new junit.framework.AssertionFailedError(e.getMessage());
1448         }
1449     }
1450 
1451     /**
1452      * Assert that a specific checkbox is not selected.
1453      *
1454      * @param checkBoxName
1455      * @param checkBoxValue
1456      */
1457     public void assertCheckboxNotSelected(String checkBoxName, String checkBoxValue) {
1458         try {
1459             tester.assertCheckboxNotSelected(checkBoxName, checkBoxValue);
1460         } catch (org.junit.ComparisonFailure e) {
1461             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1462         } catch (java.lang.AssertionError e) {
1463             throw new junit.framework.AssertionFailedError(e.getMessage());
1464         }
1465     }
1466 
1467     /**
1468      * Assert that a specific option is present in a radio group.
1469      *
1470      * @param name radio group name.
1471      * @param radioOption option to test for.
1472      */
1473     public void assertRadioOptionPresent(String name, String radioOption) {
1474         try {
1475             tester.assertRadioOptionPresent(name, radioOption);
1476         } catch (org.junit.ComparisonFailure e) {
1477             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1478         } catch (java.lang.AssertionError e) {
1479             throw new junit.framework.AssertionFailedError(e.getMessage());
1480         }
1481     }
1482 
1483     /**
1484      * Assert that a specific option is not present in a radio group.
1485      *
1486      * @param name radio group name.
1487      * @param radioOption option to test for.
1488      */
1489     public void assertRadioOptionNotPresent(String name, String radioOption) {
1490         try {
1491             tester.assertRadioOptionNotPresent(name, radioOption);
1492         } catch (org.junit.ComparisonFailure e) {
1493             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1494         } catch (java.lang.AssertionError e) {
1495             throw new junit.framework.AssertionFailedError(e.getMessage());
1496         }
1497     }
1498 
1499     /**
1500      * Assert that a specific option is selected in a radio group.
1501      *
1502      * @param name radio group name.
1503      * @param radioOption option to test for selection.
1504      */
1505     public void assertRadioOptionSelected(String name, String radioOption) {
1506         try {
1507             tester.assertRadioOptionSelected(name, radioOption);
1508         } catch (org.junit.ComparisonFailure e) {
1509             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1510         } catch (java.lang.AssertionError e) {
1511             throw new junit.framework.AssertionFailedError(e.getMessage());
1512         }
1513     }
1514 
1515     /**
1516      * Assert that a specific option is not selected in a radio group.
1517      *
1518      * @param name radio group name.
1519      * @param radioOption option to test for selection.
1520      */
1521     public void assertRadioOptionNotSelected(String name, String radioOption) {
1522         try {
1523             tester.assertRadioOptionNotSelected(name, radioOption);
1524         } catch (org.junit.ComparisonFailure e) {
1525             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1526         } catch (java.lang.AssertionError e) {
1527             throw new junit.framework.AssertionFailedError(e.getMessage());
1528         }
1529     }
1530 
1531     /**
1532      * Assert that given options are present in a select box (by label).
1533      *
1534      * @param selectName name of the select element.
1535      * @param optionLabels option labels.
1536      */
1537     public void assertSelectOptionsPresent(String selectName, String[] optionLabels) {
1538         try {
1539             tester.assertSelectOptionsPresent(selectName, optionLabels);
1540         } catch (org.junit.ComparisonFailure e) {
1541             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1542         } catch (java.lang.AssertionError e) {
1543             throw new junit.framework.AssertionFailedError(e.getMessage());
1544         }
1545     }
1546 
1547     /**
1548      * Assert that a specific option is present in a select box (by label).
1549      *
1550      * @param selectName name of the select element.
1551      * @param optionLabel option label.
1552      */
1553     public void assertSelectOptionPresent(String selectName, String optionLabel) {
1554         try {
1555             tester.assertSelectOptionPresent(selectName, optionLabel);
1556         } catch (org.junit.ComparisonFailure e) {
1557             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1558         } catch (java.lang.AssertionError e) {
1559             throw new junit.framework.AssertionFailedError(e.getMessage());
1560         }
1561     }
1562 
1563     /**
1564      * Assert that given options are present in the Nth select box (by label).
1565      *
1566      * @param selectName name of the select element.
1567      * @param index the 0-based index of the select element when multiple
1568      * select elements are expected.
1569      * @param optionLabels option labels.
1570      */
1571     public void assertSelectOptionsPresent(String selectName, int index, String[] optionLabels) {
1572         try {
1573             tester.assertSelectOptionsPresent(selectName, index, optionLabels);
1574         } catch (org.junit.ComparisonFailure e) {
1575             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1576         } catch (java.lang.AssertionError e) {
1577             throw new junit.framework.AssertionFailedError(e.getMessage());
1578         }
1579     }
1580 
1581     /**
1582      * Assert that a specific option is present in the Nth select box (by label).
1583      *
1584      * @param selectName name of the select element.
1585      * @param index the 0-based index of the select element when multiple
1586      * select elements are expected.
1587      * @param optionLabel option label.
1588      */
1589     public void assertSelectOptionPresent(String selectName, int index, String optionLabel) {
1590         try {
1591             tester.assertSelectOptionPresent(selectName, index, optionLabel);
1592         } catch (org.junit.ComparisonFailure e) {
1593             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1594         } catch (java.lang.AssertionError e) {
1595             throw new junit.framework.AssertionFailedError(e.getMessage());
1596         }
1597     }
1598 
1599     /**
1600      * Assert that given options are present in a select box (by value).
1601      *
1602      * @param selectName name of the select element.
1603      * @param optionValues option labels.
1604      */
1605     public void assertSelectOptionValuesPresent(String selectName, String[] optionValues) {
1606         try {
1607             tester.assertSelectOptionValuesPresent(selectName, optionValues);
1608         } catch (org.junit.ComparisonFailure e) {
1609             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1610         } catch (java.lang.AssertionError e) {
1611             throw new junit.framework.AssertionFailedError(e.getMessage());
1612         }
1613     }
1614 
1615     /**
1616      * Assert that a specific option is present in a select box (by value).
1617      *
1618      * @param selectName name of the select element.
1619      * @param optionValue option value.
1620      */
1621     public void assertSelectOptionValuePresent(String selectName, String optionValue) {
1622         try {
1623             tester.assertSelectOptionValuePresent(selectName, optionValue);
1624         } catch (org.junit.ComparisonFailure e) {
1625             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1626         } catch (java.lang.AssertionError e) {
1627             throw new junit.framework.AssertionFailedError(e.getMessage());
1628         }
1629     }
1630 
1631     /**
1632      * Assert that given options are present in the Nth select box (by value).
1633      *
1634      * @param selectName name of the select element.
1635      * @param index the 0-based index of the select element when multiple
1636      * select elements are expected.
1637      * @param optionValues option labels.
1638      */
1639     public void assertSelectOptionValuesPresent(String selectName, int index, String[] optionValues) {
1640         try {
1641             tester.assertSelectOptionValuesPresent(selectName, index, optionValues);
1642         } catch (org.junit.ComparisonFailure e) {
1643             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1644         } catch (java.lang.AssertionError e) {
1645             throw new junit.framework.AssertionFailedError(e.getMessage());
1646         }
1647     }
1648 
1649     /**
1650      * Assert that a specific option is present in the Nth select box (by value).
1651      *
1652      * @param selectName name of the select element.
1653      * @param index the 0-based index of the select element when multiple
1654      * select elements are expected.
1655      * @param optionValue option value.
1656      */
1657     public void assertSelectOptionValuePresent(String selectName, int index, String optionValue) {
1658         try {
1659             tester.assertSelectOptionValuePresent(selectName, index, optionValue);
1660         } catch (org.junit.ComparisonFailure e) {
1661             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1662         } catch (java.lang.AssertionError e) {
1663             throw new junit.framework.AssertionFailedError(e.getMessage());
1664         }
1665     }
1666 
1667     /**
1668      * Assert that a specific option value is not present in a select box.
1669      *
1670      * @param selectName name of the select element.
1671      * @param optionValue option value.
1672      */
1673     public void assertSelectOptionValueNotPresent(String selectName, String optionValue) {
1674         try {
1675             tester.assertSelectOptionValueNotPresent(selectName, optionValue);
1676         } catch (org.junit.ComparisonFailure e) {
1677             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1678         } catch (java.lang.AssertionError e) {
1679             throw new junit.framework.AssertionFailedError(e.getMessage());
1680         }
1681     }
1682 
1683     /**
1684      * Assert that a specific option is not present in a select box.
1685      *
1686      * @param selectName name of the select element.
1687      * @param expectedOption option label.
1688      */
1689     public void assertSelectOptionNotPresent(String selectName, String optionLabel) {
1690         try {
1691             tester.assertSelectOptionNotPresent(selectName, optionLabel);
1692         } catch (org.junit.ComparisonFailure e) {
1693             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1694         } catch (java.lang.AssertionError e) {
1695             throw new junit.framework.AssertionFailedError(e.getMessage());
1696         }
1697     }
1698 
1699     /**
1700      * Assert that a specific option value is not present in a select box.
1701      *
1702      * @param selectName name of the select element.
1703      * @param optionValue option value.
1704      */
1705     public void assertSelectOptionValueNotPresent(String selectName, int index, String optionValue) {
1706         try {
1707             tester.assertSelectOptionValueNotPresent(selectName, index, optionValue);
1708         } catch (org.junit.ComparisonFailure e) {
1709             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1710         } catch (java.lang.AssertionError e) {
1711             throw new junit.framework.AssertionFailedError(e.getMessage());
1712         }
1713     }
1714 
1715     /**
1716      * Assert that a specific option is not present in a select box.
1717      *
1718      * @param selectName name of the select element.
1719      * @param expectedOption option label.
1720      */
1721     public void assertSelectOptionNotPresent(String selectName, int index, String optionLabel) {
1722         try {
1723             tester.assertSelectOptionNotPresent(selectName, index, optionLabel);
1724         } catch (org.junit.ComparisonFailure e) {
1725             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1726         } catch (java.lang.AssertionError e) {
1727             throw new junit.framework.AssertionFailedError(e.getMessage());
1728         }
1729     }
1730 
1731     /**
1732      * Assert that the display values of a select element's options match a given array of strings.
1733      *
1734      * @param selectName name of the select element.
1735      * @param expectedOptions expected labels for the select box.
1736      */
1737     public void assertSelectOptionsEqual(String selectName, String[] expectedOptions) {
1738         try {
1739             tester.assertSelectOptionsEqual(selectName, expectedOptions);
1740         } catch (org.junit.ComparisonFailure e) {
1741             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1742         } catch (java.lang.AssertionError e) {
1743             throw new junit.framework.AssertionFailedError(e.getMessage());
1744         }
1745     }
1746 
1747     /**
1748      * Assert that the display values of
1749      * the Nth select element's options match a given array of strings.
1750      *
1751      * @param selectName name of the select element.
1752      * @param index the 0-based index of the select element when multiple
1753      * select elements are expected.
1754      * @param expectedOptions expected labels for the select box.
1755      */
1756     public void assertSelectOptionsEqual(String selectName, int index, String[] expectedOptions) {
1757         try {
1758             tester.assertSelectOptionsEqual(selectName, index, expectedOptions);
1759         } catch (org.junit.ComparisonFailure e) {
1760             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1761         } catch (java.lang.AssertionError e) {
1762             throw new junit.framework.AssertionFailedError(e.getMessage());
1763         }
1764     }
1765 
1766     /**
1767      * Assert that the display values of a select element's options do not match a given array of strings.
1768      *
1769      * @param selectName name of the select element.
1770      * @param expectedOptions expected display values for the select box.
1771      */
1772     public void assertSelectOptionsNotEqual(String selectName, String[] expectedOptions) {
1773         try {
1774             tester.assertSelectOptionsNotEqual(selectName, expectedOptions);
1775         } catch (org.junit.ComparisonFailure e) {
1776             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1777         } catch (java.lang.AssertionError e) {
1778             throw new junit.framework.AssertionFailedError(e.getMessage());
1779         }
1780     }
1781 
1782     /**
1783      * Assert that the display values of the Nth select element's
1784      * options do not match a given array of strings.
1785      *
1786      * @param selectName name of the select element.
1787      * @param index the 0-based index of the select element when multiple
1788      * select elements are expected.
1789      * @param expectedOptions expected display values for the select box.
1790      */
1791     public void assertSelectOptionsNotEqual(String selectName, int index, String[] expectedOptions) {
1792         try {
1793             tester.assertSelectOptionsNotEqual(selectName, index, expectedOptions);
1794         } catch (org.junit.ComparisonFailure e) {
1795             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1796         } catch (java.lang.AssertionError e) {
1797             throw new junit.framework.AssertionFailedError(e.getMessage());
1798         }
1799     }
1800 
1801     /**
1802      * Assert that the values of the Nth select element's options match
1803      * a given array of strings.
1804      *
1805      * @param selectName name of the select element.
1806      * @param index the 0-based index of the select element when multiple
1807      * select elements are expected.
1808      * @param expectedValues expected values for the select box.
1809      */
1810     public void assertSelectOptionValuesEqual(String selectName, int index, String[] expectedValues) {
1811         try {
1812             tester.assertSelectOptionValuesEqual(selectName, index, expectedValues);
1813         } catch (org.junit.ComparisonFailure e) {
1814             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1815         } catch (java.lang.AssertionError e) {
1816             throw new junit.framework.AssertionFailedError(e.getMessage());
1817         }
1818     }
1819 
1820     /**
1821      * Assert that the values of a select element's options match a given array of strings.
1822      *
1823      * @param selectName name of the select element.
1824      * @param expectedValues expected values for the select box.
1825      */
1826     public void assertSelectOptionValuesEqual(String selectName, String[] expectedValues) {
1827         try {
1828             tester.assertSelectOptionValuesEqual(selectName, expectedValues);
1829         } catch (org.junit.ComparisonFailure e) {
1830             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1831         } catch (java.lang.AssertionError e) {
1832             throw new junit.framework.AssertionFailedError(e.getMessage());
1833         }
1834     }
1835 
1836     /**
1837      * Assert that the values of a select element's options do not match a given array of strings.
1838      *
1839      * @param selectName name of the select element.
1840      * @param optionValues expected values for the select box.
1841      */
1842     public void assertSelectOptionValuesNotEqual(String selectName, String[] optionValues) {
1843         try {
1844             tester.assertSelectOptionValuesNotEqual(selectName, optionValues);
1845         } catch (org.junit.ComparisonFailure e) {
1846             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1847         } catch (java.lang.AssertionError e) {
1848             throw new junit.framework.AssertionFailedError(e.getMessage());
1849         }
1850     }
1851 
1852     /**
1853      * Assert that the values of the Nth select element's options do not match a
1854      * given array of strings.
1855      *
1856      * @param selectName name of the select element.
1857      * @param index the 0-based index of the select element when multiple
1858      * select elements are expected.
1859      * @param optionValues expected values for the select box.
1860      */
1861     public void assertSelectOptionValuesNotEqual(String selectName, int index, String[] optionValues) {
1862         try {
1863             tester.assertSelectOptionValuesNotEqual(selectName, index, optionValues);
1864         } catch (org.junit.ComparisonFailure e) {
1865             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1866         } catch (java.lang.AssertionError e) {
1867             throw new junit.framework.AssertionFailedError(e.getMessage());
1868         }
1869     }
1870 
1871     /**
1872      * Assert that the currently selected display label(s) of a select box matches given label(s).
1873      *
1874      * @param selectName name of the select element.
1875      * @param labels expected display label(s) of the selected option.
1876      */
1877     public void assertSelectedOptionsEqual(String selectName, String[] labels) {
1878         try {
1879             tester.assertSelectedOptionsEqual(selectName, labels);
1880         } catch (org.junit.ComparisonFailure e) {
1881             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1882         } catch (java.lang.AssertionError e) {
1883             throw new junit.framework.AssertionFailedError(e.getMessage());
1884         }
1885     }
1886 
1887     /**
1888      * Assert that the currently selected display label(s) of a select box matches given label(s).
1889      *
1890      * @param selectName name of the select element.
1891      * @param index the 0-based index used when more than one select element
1892      * with the same name is expected.
1893      * @param labels expected display label(s) of the selected option.
1894      */
1895     public void assertSelectedOptionsEqual(String selectName, int index, String[] labels) {
1896         try {
1897             tester.assertSelectedOptionsEqual(selectName, index, labels);
1898         } catch (org.junit.ComparisonFailure e) {
1899             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1900         } catch (java.lang.AssertionError e) {
1901             throw new junit.framework.AssertionFailedError(e.getMessage());
1902         }
1903     }
1904 
1905     /**
1906      * Assert that the label of the current selected option matches
1907      * the provided value.
1908      * @param selectName name of the select element
1909      * @param optionLabel expected value of the option label
1910      */
1911     public void assertSelectedOptionEquals(String selectName, String optionLabel) {
1912         try {
1913             tester.assertSelectedOptionEquals(selectName, optionLabel);
1914         } catch (org.junit.ComparisonFailure e) {
1915             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1916         } catch (java.lang.AssertionError e) {
1917             throw new junit.framework.AssertionFailedError(e.getMessage());
1918         }
1919     }
1920 
1921     /**
1922      * Assert that the label of the current selected option matches
1923      * the provided value in the Nth select element with the specified name.
1924      * @param selectName name of the select element
1925      * @param index the 0-based index used when more than one select element
1926      * with the same name is expected.
1927      * @param optionLabel expected value of the option label
1928      */
1929     public void assertSelectedOptionEquals(String selectName, int index, String option) {
1930         try {
1931             tester.assertSelectedOptionEquals(selectName, index, option);
1932         } catch (org.junit.ComparisonFailure e) {
1933             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1934         } catch (java.lang.AssertionError e) {
1935             throw new junit.framework.AssertionFailedError(e.getMessage());
1936         }
1937     }
1938 
1939     /**
1940      * Assert that the currently selected value(s) of a select box matches given value(s).
1941      *
1942      * @param selectName name of the select element.
1943      * @param values expected value(s) of the selected option.
1944      */
1945     public void assertSelectedOptionValuesEqual(String selectName, String[] values) {
1946         try {
1947             tester.assertSelectedOptionValuesEqual(selectName, values);
1948         } catch (org.junit.ComparisonFailure e) {
1949             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1950         } catch (java.lang.AssertionError e) {
1951             throw new junit.framework.AssertionFailedError(e.getMessage());
1952         }
1953     }
1954 
1955     /**
1956      * Assert that the currently selected value(s) of the Nth
1957      * select box with the specified name matches given value(s).
1958      *
1959      * @param selectName name of the select element.
1960      * @param index the 0-based index used when more than one select element
1961      * with the same name is expected.
1962      * @param values expected value(s) of the selected option.
1963      */
1964     public void assertSelectedOptionValuesEqual(String selectName, int index, String[] values) {
1965         try {
1966             tester.assertSelectedOptionValuesEqual(selectName, index, values);
1967         } catch (org.junit.ComparisonFailure e) {
1968             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1969         } catch (java.lang.AssertionError e) {
1970             throw new junit.framework.AssertionFailedError(e.getMessage());
1971         }
1972     }
1973 
1974     /**
1975      * Assert that the currently selected value of a select box matches given value.
1976      *
1977      * @param selectName name of the select element.
1978      * @param value expected value of the selected option.
1979      */
1980     public void assertSelectedOptionValueEquals(String selectName, String value) {
1981         try {
1982             tester.assertSelectedOptionValueEquals(selectName, value);
1983         } catch (org.junit.ComparisonFailure e) {
1984             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
1985         } catch (java.lang.AssertionError e) {
1986             throw new junit.framework.AssertionFailedError(e.getMessage());
1987         }
1988     }
1989 
1990     /**
1991      * Assert that the currently selected value of a select box matches given value.
1992      *
1993      * @param selectName name of the select element.
1994      * @param index the 0-based index used when more than one select element
1995      * with the same name is expected.
1996      * @param value expected value of the selected option.
1997      */
1998     public void assertSelectedOptionValueEquals(String selectName, int index, String value) {
1999         try {
2000             tester.assertSelectedOptionValueEquals(selectName, index, value);
2001         } catch (org.junit.ComparisonFailure e) {
2002             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2003         } catch (java.lang.AssertionError e) {
2004             throw new junit.framework.AssertionFailedError(e.getMessage());
2005         }
2006     }
2007 
2008     /**
2009      * Assert that the currently selected display value(s) of a select box matches a given value(s).
2010      *
2011      * @param selectName name of the select element.
2012      * @param regexps expected display value of the selected option.
2013      */
2014     public void assertSelectedOptionsMatch(String selectName, String[] regexps) {
2015         try {
2016             tester.assertSelectedOptionsMatch(selectName, regexps);
2017         } catch (org.junit.ComparisonFailure e) {
2018             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2019         } catch (java.lang.AssertionError e) {
2020             throw new junit.framework.AssertionFailedError(e.getMessage());
2021         }
2022     }
2023 
2024     /**
2025      * Assert that the currently selected display value(s) of a select box matches a given value(s).
2026      *
2027      * @param selectName name of the select element.
2028      * @param index the 0-based index used when more than one select element
2029      * with the same name is expected.
2030      * @param regexps expected display value of the selected option.
2031      */
2032     public void assertSelectedOptionsMatch(String selectName, int index, String[] regexps) {
2033         try {
2034             tester.assertSelectedOptionsMatch(selectName, index, regexps);
2035         } catch (org.junit.ComparisonFailure e) {
2036             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2037         } catch (java.lang.AssertionError e) {
2038             throw new junit.framework.AssertionFailedError(e.getMessage());
2039         }
2040     }
2041 
2042     /**
2043      * Assert that the label of the current selected option matches
2044      * the provided regular expression value.
2045      * @param selectName name of the select element
2046      * @param regexp the regular expression to match
2047      */
2048     public void assertSelectedOptionMatches(String selectName, String regexp) {
2049         try {
2050             tester.assertSelectedOptionMatches(selectName, regexp);
2051         } catch (org.junit.ComparisonFailure e) {
2052             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2053         } catch (java.lang.AssertionError e) {
2054             throw new junit.framework.AssertionFailedError(e.getMessage());
2055         }
2056     }
2057 
2058     /**
2059      * Assert that the label of the current selected option matches
2060      * the provided regular expression in the Nth select element with the specified name.
2061      * @param selectName name of the select element
2062      * @param index the 0-based index used when more than one select element
2063      * with the same name is expected.
2064      * @param regexp the regular expression to match
2065      */
2066     public void assertSelectedOptionMatches(String selectName, int index, String regexp) {
2067         try {
2068             tester.assertSelectedOptionMatches(selectName, index, regexp);
2069         } catch (org.junit.ComparisonFailure e) {
2070             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2071         } catch (java.lang.AssertionError e) {
2072             throw new junit.framework.AssertionFailedError(e.getMessage());
2073         }
2074     }
2075 
2076     /**
2077      * Assert that a submit button is present. <br/> A submit button can be the following HTML elements:
2078      * <ul>
2079      * <li>submit input
2080      * <li>image input
2081      * <li>submit button
2082      * </ul>
2083      *
2084      */
2085     public void assertSubmitButtonPresent() {
2086         try {
2087             tester.assertSubmitButtonPresent();
2088         } catch (org.junit.ComparisonFailure e) {
2089             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2090         } catch (java.lang.AssertionError e) {
2091             throw new junit.framework.AssertionFailedError(e.getMessage());
2092         }
2093     }
2094 
2095     /**
2096      * Assert that a submit button with a given name is present. <br/> A submit button can be the following HTML
2097      * elements:
2098      * <ul>
2099      * <li>submit input
2100      * <li>image input
2101      * <li>submit button
2102      * </ul>
2103      *
2104      * @param buttonName
2105      */
2106     public void assertSubmitButtonPresent(String buttonName) {
2107         try {
2108             tester.assertSubmitButtonPresent(buttonName);
2109         } catch (org.junit.ComparisonFailure e) {
2110             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2111         } catch (java.lang.AssertionError e) {
2112             throw new junit.framework.AssertionFailedError(e.getMessage());
2113         }
2114     }
2115 
2116     /**
2117      * Assert that no submit button is present in the current form. <br/> A submit button can be the following HTML
2118      * elements:
2119      * <ul>
2120      * <li>submit input
2121      * <li>image input
2122      * <li>submit button
2123      * </ul>
2124      *
2125      * @param buttonName
2126      */
2127     public void assertSubmitButtonNotPresent() {
2128         try {
2129             tester.assertSubmitButtonNotPresent();
2130         } catch (org.junit.ComparisonFailure e) {
2131             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2132         } catch (java.lang.AssertionError e) {
2133             throw new junit.framework.AssertionFailedError(e.getMessage());
2134         }
2135     }
2136 
2137     /**
2138      * Assert that a submit button with a given name is not present. <br/> A submit button can be the following HTML
2139      * elements:
2140      * <ul>
2141      * <li>submit input
2142      * <li>image input
2143      * <li>submit button
2144      * </ul>
2145      *
2146      * @param buttonName
2147      */
2148     public void assertSubmitButtonNotPresent(String buttonName) {
2149         try {
2150             tester.assertSubmitButtonNotPresent(buttonName);
2151         } catch (org.junit.ComparisonFailure e) {
2152             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2153         } catch (java.lang.AssertionError e) {
2154             throw new junit.framework.AssertionFailedError(e.getMessage());
2155         }
2156     }
2157 
2158     /**
2159      * Assert that a submit button with a given name and value is present. <br/> A submit button can be the following
2160      * HTML elements:
2161      * <ul>
2162      * <li>submit input
2163      * <li>image input
2164      * <li>submit button
2165      * </ul>
2166      *
2167      * @param buttonName
2168      * @param buttonValue
2169      */
2170     public void assertSubmitButtonPresent(String buttonName, String buttonValue) {
2171         try {
2172             tester.assertSubmitButtonPresent(buttonName, buttonValue);
2173         } catch (org.junit.ComparisonFailure e) {
2174             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2175         } catch (java.lang.AssertionError e) {
2176             throw new junit.framework.AssertionFailedError(e.getMessage());
2177         }
2178     }
2179 
2180     /**
2181      * Assert that a reset button is present. <br/> A reset button can be the following HTML elements:
2182      * <ul>
2183      * <li>reset input
2184      * <li>reset button
2185      * </ul>
2186      *
2187      */
2188     public void assertResetButtonPresent() {
2189         try {
2190             tester.assertResetButtonPresent();
2191         } catch (org.junit.ComparisonFailure e) {
2192             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2193         } catch (java.lang.AssertionError e) {
2194             throw new junit.framework.AssertionFailedError(e.getMessage());
2195         }
2196     }
2197 
2198     /**
2199      * Assert that a reset button with a given name is present.<br/> A reset button can be the following HTML elements:
2200      * <ul>
2201      * <li>reset input
2202      * <li>reset button
2203      * </ul>
2204      *
2205      * @param buttonName
2206      */
2207     public void assertResetButtonPresent(String buttonName) {
2208         try {
2209             tester.assertResetButtonPresent(buttonName);
2210         } catch (org.junit.ComparisonFailure e) {
2211             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2212         } catch (java.lang.AssertionError e) {
2213             throw new junit.framework.AssertionFailedError(e.getMessage());
2214         }
2215     }
2216 
2217     /**
2218      * Assert that no reset button is present in the current form.<br/> A reset button can be the following HTML
2219      * elements:
2220      * <ul>
2221      * <li>reset input
2222      * <li>reset button
2223      * </ul>
2224      *
2225      * @param buttonName
2226      */
2227     public void assertResetButtonNotPresent() {
2228         try {
2229             tester.assertResetButtonNotPresent();
2230         } catch (org.junit.ComparisonFailure e) {
2231             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2232         } catch (java.lang.AssertionError e) {
2233             throw new junit.framework.AssertionFailedError(e.getMessage());
2234         }
2235     }
2236 
2237     /**
2238      * Assert that a reset button with a given name is not present.<br/> A reset button can be the following HTML
2239      * elements:
2240      * <ul>
2241      * <li>reset input
2242      * <li>reset button
2243      * </ul>
2244      *
2245      * @param buttonName
2246      */
2247     public void assertResetButtonNotPresent(String buttonName) {
2248         try {
2249             tester.assertResetButtonNotPresent(buttonName);
2250         } catch (org.junit.ComparisonFailure e) {
2251             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2252         } catch (java.lang.AssertionError e) {
2253             throw new junit.framework.AssertionFailedError(e.getMessage());
2254         }
2255     }
2256 
2257     /**
2258      * Assert that a button with a given id is present in the current window.<br/> A button can be the following HTML
2259      * elements:
2260      * <ul>
2261      * <li>button input
2262      * <li>button button
2263      * </ul>
2264      *
2265      * @param buttonId
2266      */
2267     public void assertButtonPresent(String buttonId) {
2268         try {
2269             tester.assertButtonPresent(buttonId);
2270         } catch (org.junit.ComparisonFailure e) {
2271             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2272         } catch (java.lang.AssertionError e) {
2273             throw new junit.framework.AssertionFailedError(e.getMessage());
2274         }
2275     }
2276 
2277     /**
2278      * Assert that a button with a given text is present in the current window.
2279      *
2280      * @param text Text representation of button content.
2281      */
2282     public void assertButtonPresentWithText(String text) {
2283         try {
2284             tester.assertButtonPresentWithText(text);
2285         } catch (org.junit.ComparisonFailure e) {
2286             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2287         } catch (java.lang.AssertionError e) {
2288             throw new junit.framework.AssertionFailedError(e.getMessage());
2289         }
2290     }
2291 
2292     /**
2293      * Assert that a button with a given text is not present in the current window.
2294      *
2295      * @param text Text representation of button content.
2296      */
2297     public void assertButtonNotPresentWithText(String text) {
2298         try {
2299             tester.assertButtonNotPresentWithText(text);
2300         } catch (org.junit.ComparisonFailure e) {
2301             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2302         } catch (java.lang.AssertionError e) {
2303             throw new junit.framework.AssertionFailedError(e.getMessage());
2304         }
2305     }
2306 
2307     /**
2308      * Assert that a button with a given id is not present in the current window.
2309      *
2310      * @param buttonId
2311      */
2312     public void assertButtonNotPresent(String buttonId) {
2313         try {
2314             tester.assertButtonNotPresent(buttonId);
2315         } catch (org.junit.ComparisonFailure e) {
2316             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2317         } catch (java.lang.AssertionError e) {
2318             throw new junit.framework.AssertionFailedError(e.getMessage());
2319         }
2320     }
2321 
2322     /**
2323      * Assert that a link with a given id is present in the response.
2324      *
2325      * @param linkId
2326      */
2327     public void assertLinkPresent(String linkId) {
2328         try {
2329             tester.assertLinkPresent(linkId);
2330         } catch (org.junit.ComparisonFailure e) {
2331             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2332         } catch (java.lang.AssertionError e) {
2333             throw new junit.framework.AssertionFailedError(e.getMessage());
2334         }
2335     }
2336 
2337     /**
2338      * Assert that no link with the given id is present in the response.
2339      *
2340      * @param linkId
2341      */
2342     public void assertLinkNotPresent(String linkId) {
2343         try {
2344             tester.assertLinkNotPresent(linkId);
2345         } catch (org.junit.ComparisonFailure e) {
2346             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2347         } catch (java.lang.AssertionError e) {
2348             throw new junit.framework.AssertionFailedError(e.getMessage());
2349         }
2350     }
2351 
2352     /**
2353      * Assert that a link containing the supplied text is present.
2354      *
2355      * @param linkText
2356      */
2357     public void assertLinkPresentWithText(String linkText) {
2358         try {
2359             tester.assertLinkPresentWithText(linkText);
2360         } catch (org.junit.ComparisonFailure e) {
2361             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2362         } catch (java.lang.AssertionError e) {
2363             throw new junit.framework.AssertionFailedError(e.getMessage());
2364         }
2365     }
2366 
2367     /**
2368      * Assert that no link containing the supplied text is present.
2369      *
2370      * @param linkText
2371      */
2372     public void assertLinkNotPresentWithText(String linkText) {
2373         try {
2374             tester.assertLinkNotPresentWithText(linkText);
2375         } catch (org.junit.ComparisonFailure e) {
2376             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2377         } catch (java.lang.AssertionError e) {
2378             throw new junit.framework.AssertionFailedError(e.getMessage());
2379         }
2380     }
2381 
2382     /**
2383      * Assert that a link containing the supplied text is present.
2384      *
2385      * @param linkText
2386      * @param index The 0-based index, when more than one link with the same text is expected.
2387      */
2388     public void assertLinkPresentWithText(String linkText, int index) {
2389         try {
2390             tester.assertLinkPresentWithText(linkText, index);
2391         } catch (org.junit.ComparisonFailure e) {
2392             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2393         } catch (java.lang.AssertionError e) {
2394             throw new junit.framework.AssertionFailedError(e.getMessage());
2395         }
2396     }
2397 
2398     /**
2399      * Assert that no link containing the supplied text is present.
2400      *
2401      * @param linkText
2402      * @param index The 0-based index, when more than one link with the same text is expected.
2403      */
2404     public void assertLinkNotPresentWithText(String linkText, int index) {
2405         try {
2406             tester.assertLinkNotPresentWithText(linkText, index);
2407         } catch (org.junit.ComparisonFailure e) {
2408             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2409         } catch (java.lang.AssertionError e) {
2410             throw new junit.framework.AssertionFailedError(e.getMessage());
2411         }
2412     }
2413 
2414     /**
2415      * Assert that a link containing the Exact text is present.
2416      *
2417      * @param linkText
2418      */
2419     public void assertLinkPresentWithExactText(String linkText) {
2420         try {
2421             tester.assertLinkPresentWithExactText(linkText);
2422         } catch (org.junit.ComparisonFailure e) {
2423             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2424         } catch (java.lang.AssertionError e) {
2425             throw new junit.framework.AssertionFailedError(e.getMessage());
2426         }
2427     }
2428 
2429     /**
2430      * Assert that no link containing the Exact text is present.
2431      *
2432      * @param linkText
2433      */
2434     public void assertLinkNotPresentWithExactText(String linkText) {
2435         try {
2436             tester.assertLinkNotPresentWithExactText(linkText);
2437         } catch (org.junit.ComparisonFailure e) {
2438             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2439         } catch (java.lang.AssertionError e) {
2440             throw new junit.framework.AssertionFailedError(e.getMessage());
2441         }
2442     }
2443 
2444     /**
2445      * Assert that a link containing the Exact text is present.
2446      *
2447      * @param linkText
2448      * @param index The 0-based index, when more than one link with the same text is expected.
2449      */
2450     public void assertLinkPresentWithExactText(String linkText, int index) {
2451         try {
2452             tester.assertLinkPresentWithExactText(linkText, index);
2453         } catch (org.junit.ComparisonFailure e) {
2454             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2455         } catch (java.lang.AssertionError e) {
2456             throw new junit.framework.AssertionFailedError(e.getMessage());
2457         }
2458     }
2459 
2460     /**
2461      * Assert that no link containing the Exact text is present.
2462      *
2463      * @param linkText
2464      * @param index The 0-based index, when more than one link with the same text is expected.
2465      */
2466     public void assertLinkNotPresentWithExactText(String linkText, int index) {
2467         try {
2468             tester.assertLinkNotPresentWithExactText(linkText, index);
2469         } catch (org.junit.ComparisonFailure e) {
2470             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2471         } catch (java.lang.AssertionError e) {
2472             throw new junit.framework.AssertionFailedError(e.getMessage());
2473         }
2474     }
2475 
2476     /**
2477      * Assert that a link containing a specified image is present.
2478      *
2479      * @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
2480      *            you could just pass in <tt>"my_icon.png"</tt>.
2481      */
2482     public void assertLinkPresentWithImage(String imageFileName) {
2483         try {
2484             tester.assertLinkPresentWithImage(imageFileName);
2485         } catch (org.junit.ComparisonFailure e) {
2486             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2487         } catch (java.lang.AssertionError e) {
2488             throw new junit.framework.AssertionFailedError(e.getMessage());
2489         }
2490     }
2491 
2492     /**
2493      * Assert that a link containing a specified image is present.
2494      *
2495      * @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
2496      *            you could just pass in <tt>"my_icon.png"</tt>.
2497      * @param index The 0-based index, when more than one link with the same image is expected.
2498      */
2499     public void assertLinkPresentWithImage(String imageFileName, int index) {
2500         try {
2501             tester.assertLinkPresentWithImage(imageFileName, index);
2502         } catch (org.junit.ComparisonFailure e) {
2503             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2504         } catch (java.lang.AssertionError e) {
2505             throw new junit.framework.AssertionFailedError(e.getMessage());
2506         }
2507     }
2508 
2509     /**
2510      * Assert that a link containing a specified image is not present.
2511      *
2512      * @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
2513      *            you could just pass in <tt>"my_icon.png"</tt>.
2514      */
2515     public void assertLinkNotPresentWithImage(String imageFileName) {
2516         try {
2517             tester.assertLinkNotPresentWithImage(imageFileName);
2518         } catch (org.junit.ComparisonFailure e) {
2519             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2520         } catch (java.lang.AssertionError e) {
2521             throw new junit.framework.AssertionFailedError(e.getMessage());
2522         }
2523     }
2524 
2525     /**
2526      * Assert that a link containing a specified image is not present.
2527      *
2528      * @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
2529      *            you could just pass in <tt>"my_icon.png"</tt>.
2530      * @param index The 0-based index, when more than one link with the same image is expected.
2531      */
2532     public void assertLinkNotPresentWithImage(String imageFileName, int index) {
2533         try {
2534             tester.assertLinkNotPresentWithImage(imageFileName, index);
2535         } catch (org.junit.ComparisonFailure e) {
2536             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2537         } catch (java.lang.AssertionError e) {
2538             throw new junit.framework.AssertionFailedError(e.getMessage());
2539         }
2540     }
2541 
2542     /**
2543      * Assert that an element with a given id is present.
2544      *
2545      * @param anID element id to test for.
2546      */
2547     public void assertElementPresent(String anID) {
2548         try {
2549             tester.assertElementPresent(anID);
2550         } catch (org.junit.ComparisonFailure e) {
2551             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2552         } catch (java.lang.AssertionError e) {
2553             throw new junit.framework.AssertionFailedError(e.getMessage());
2554         }
2555     }
2556 
2557     /**
2558      * Assert that an element with a given id is not present.
2559      *
2560      * @param anID element id to test for.
2561      */
2562     public void assertElementNotPresent(String anID) {
2563         try {
2564             tester.assertElementNotPresent(anID);
2565         } catch (org.junit.ComparisonFailure e) {
2566             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2567         } catch (java.lang.AssertionError e) {
2568             throw new junit.framework.AssertionFailedError(e.getMessage());
2569         }
2570     }
2571 
2572     /**
2573      * Assert that an element with a given xpath is present.
2574      *
2575      * @param xpath element xpath to test for.
2576      */
2577     public void assertElementPresentByXPath(String xpath) {
2578         try {
2579             tester.assertElementPresentByXPath(xpath);
2580         } catch (org.junit.ComparisonFailure e) {
2581             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2582         } catch (java.lang.AssertionError e) {
2583             throw new junit.framework.AssertionFailedError(e.getMessage());
2584         }
2585     }
2586 
2587     /**
2588      * Assert that an element with a given xpath is not present.
2589      *
2590      * @param xpath element xpath to test for.
2591      */
2592     public void assertElementNotPresentByXPath(String xpath) {
2593         try {
2594             tester.assertElementNotPresentByXPath(xpath);
2595         } catch (org.junit.ComparisonFailure e) {
2596             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2597         } catch (java.lang.AssertionError e) {
2598             throw new junit.framework.AssertionFailedError(e.getMessage());
2599         }
2600     }
2601 
2602     /**
2603      * Get all the comments in a document, as a list of strings.
2604      */
2605     public List<String> getComments() {
2606         try {
2607             return tester.getComments();
2608         } catch (org.junit.ComparisonFailure e) {
2609             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2610         } catch (java.lang.AssertionError e) {
2611             throw new junit.framework.AssertionFailedError(e.getMessage());
2612         }
2613     }
2614 
2615     /**
2616      * Assert that a comment is present.
2617      *
2618      * @param comment
2619      */
2620     public void assertCommentPresent(String comment) {
2621         try {
2622             tester.assertCommentPresent(comment);
2623         } catch (org.junit.ComparisonFailure e) {
2624             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2625         } catch (java.lang.AssertionError e) {
2626             throw new junit.framework.AssertionFailedError(e.getMessage());
2627         }
2628     }
2629 
2630     /**
2631      * Assert that a comment is not present.
2632      *
2633      * @param comment
2634      */
2635     public void assertCommentNotPresent(String comment) {
2636         try {
2637             tester.assertCommentNotPresent(comment);
2638         } catch (org.junit.ComparisonFailure e) {
2639             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2640         } catch (java.lang.AssertionError e) {
2641             throw new junit.framework.AssertionFailedError(e.getMessage());
2642         }
2643     }
2644 
2645     /**
2646      * Assert that a given element contains specific text.
2647      *
2648      * @param elementID id of element to be inspected.
2649      * @param text to check for.
2650      */
2651     public void assertTextInElement(String elementID, String text) {
2652         try {
2653             tester.assertTextInElement(elementID, text);
2654         } catch (org.junit.ComparisonFailure e) {
2655             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2656         } catch (java.lang.AssertionError e) {
2657             throw new junit.framework.AssertionFailedError(e.getMessage());
2658         }
2659     }
2660 
2661     
2662     public void assertTextNotInElement(String elementID, String text) {
2663         try {
2664             tester.assertTextNotInElement(elementID, text);
2665         } catch (org.junit.ComparisonFailure e) {
2666             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2667         } catch (java.lang.AssertionError e) {
2668             throw new junit.framework.AssertionFailedError(e.getMessage());
2669         }
2670     }
2671 
2672     /**
2673      * Assert that a given element matches a specific regexp.
2674      *
2675      * @param elementID id of element to be inspected.
2676      * @param regexp to match.
2677      */
2678     public void assertMatchInElement(String elementID, String regexp) {
2679         try {
2680             tester.assertMatchInElement(elementID, regexp);
2681         } catch (org.junit.ComparisonFailure e) {
2682             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2683         } catch (java.lang.AssertionError e) {
2684             throw new junit.framework.AssertionFailedError(e.getMessage());
2685         }
2686     }
2687 
2688     /**
2689      * Assert that a given element does not match a specific regexp.
2690      *
2691      * @param elementID id of element to be inspected.
2692      * @param regexp to match.
2693      */
2694     public void assertNoMatchInElement(String elementID, String regexp) {
2695         try {
2696             tester.assertNoMatchInElement(elementID, regexp);
2697         } catch (org.junit.ComparisonFailure e) {
2698             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2699         } catch (java.lang.AssertionError e) {
2700             throw new junit.framework.AssertionFailedError(e.getMessage());
2701         }
2702     }
2703 
2704     /**
2705      * Assert that a window with the given name is open.
2706      *
2707      * @param windowName
2708      */
2709     public void assertWindowPresent(String windowName) {
2710         try {
2711             tester.assertWindowPresent(windowName);
2712         } catch (org.junit.ComparisonFailure e) {
2713             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2714         } catch (java.lang.AssertionError e) {
2715             throw new junit.framework.AssertionFailedError(e.getMessage());
2716         }
2717     }
2718 
2719     /**
2720      * Assert that a window with the given ID is open.
2721      *
2722      * @param windowID Javascript window ID.
2723      */
2724     public void assertWindowPresent(int windowID) {
2725         try {
2726             tester.assertWindowPresent(windowID);
2727         } catch (org.junit.ComparisonFailure e) {
2728             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2729         } catch (java.lang.AssertionError e) {
2730             throw new junit.framework.AssertionFailedError(e.getMessage());
2731         }
2732     }
2733 
2734     /**
2735      * Assert that at least one window with the given title is open.
2736      *
2737      * @param title
2738      */
2739     public void assertWindowPresentWithTitle(String title) {
2740         try {
2741             tester.assertWindowPresentWithTitle(title);
2742         } catch (org.junit.ComparisonFailure e) {
2743             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2744         } catch (java.lang.AssertionError e) {
2745             throw new junit.framework.AssertionFailedError(e.getMessage());
2746         }
2747     }
2748 
2749     /**
2750      * Assert that the number of opened windows equals given value.
2751      *
2752      * @param windowCount Window count
2753      */
2754     public void assertWindowCountEquals(int windowCount) {
2755         try {
2756             tester.assertWindowCountEquals(windowCount);
2757         } catch (org.junit.ComparisonFailure e) {
2758             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2759         } catch (java.lang.AssertionError e) {
2760             throw new junit.framework.AssertionFailedError(e.getMessage());
2761         }
2762     }
2763 
2764     /**
2765      * Assert that a frame with the given name or ID is present.
2766      *
2767      * @param frameNameOrId Name or ID of the frame. ID is checked first.
2768      */
2769     public void assertFramePresent(String frameNameOrId) {
2770         try {
2771             tester.assertFramePresent(frameNameOrId);
2772         } catch (org.junit.ComparisonFailure e) {
2773             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2774         } catch (java.lang.AssertionError e) {
2775             throw new junit.framework.AssertionFailedError(e.getMessage());
2776         }
2777     }
2778 
2779     /**
2780      * Checks to see if a cookie is present in the response.
2781      *
2782      * @param cookieName The cookie name
2783      */
2784     public void assertCookiePresent(String cookieName) {
2785         try {
2786             tester.assertCookiePresent(cookieName);
2787         } catch (org.junit.ComparisonFailure e) {
2788             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2789         } catch (java.lang.AssertionError e) {
2790             throw new junit.framework.AssertionFailedError(e.getMessage());
2791         }
2792     }
2793 
2794     /**
2795      * Check to see if a cookie has the given value.
2796      *
2797      * @param cookieName The cookie name
2798      * @param expectedValue The cookie value
2799      */
2800     public void assertCookieValueEquals(String cookieName, String expectedValue) {
2801         try {
2802             tester.assertCookieValueEquals(cookieName, expectedValue);
2803         } catch (org.junit.ComparisonFailure e) {
2804             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2805         } catch (java.lang.AssertionError e) {
2806             throw new junit.framework.AssertionFailedError(e.getMessage());
2807         }
2808     }
2809 
2810     /**
2811      * Check to see if a cookie value match the given regexp.
2812      *
2813      * @param cookieName The cookie name
2814      * @param regexp The regexp
2815      */
2816     public void assertCookieValueMatch(String cookieName, String regexp) {
2817         try {
2818             tester.assertCookieValueMatch(cookieName, regexp);
2819         } catch (org.junit.ComparisonFailure e) {
2820             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2821         } catch (java.lang.AssertionError e) {
2822             throw new junit.framework.AssertionFailedError(e.getMessage());
2823         }
2824     }
2825 
2826     /**
2827      * @deprecated Use {@link WebTester#getElementAttributeByXPath(String, String)}
2828      */
2829     public String getFormElementValue(String formElementName) {
2830         try {
2831             return tester.getFormElementValue(formElementName);
2832         } catch (org.junit.ComparisonFailure e) {
2833             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2834         } catch (java.lang.AssertionError e) {
2835             throw new junit.framework.AssertionFailedError(e.getMessage());
2836         }
2837     }
2838 
2839     /**
2840      * Begin interaction with a specified form. If form interaction methods are called without explicitly calling this
2841      * method first, JWebUnit will attempt to determine itself which form is being manipulated.
2842      *
2843      * It is not necessary to call this method if their is only one form on the current page.
2844      *
2845      * @param index 0-based index of the form to work with.
2846      */
2847     public void setWorkingForm(int index) {
2848         try {
2849             tester.setWorkingForm(index);
2850         } catch (org.junit.ComparisonFailure e) {
2851             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2852         } catch (java.lang.AssertionError e) {
2853             throw new junit.framework.AssertionFailedError(e.getMessage());
2854         }
2855     }
2856 
2857     /**
2858      * Begin interaction with a specified form. If form interaction methods are called without explicitly calling this
2859      * method first, JWebUnit will attempt to determine itself which form is being manipulated.
2860      *
2861      * It is not necessary to call this method if their is only one form on the current page.
2862      *
2863      * @param nameOrId name or id of the form to work with.
2864      */
2865     public void setWorkingForm(String nameOrId) {
2866         try {
2867             tester.setWorkingForm(nameOrId);
2868         } catch (org.junit.ComparisonFailure e) {
2869             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2870         } catch (java.lang.AssertionError e) {
2871             throw new junit.framework.AssertionFailedError(e.getMessage());
2872         }
2873     }
2874 
2875     /**
2876      * Begin interaction with a specified form. If form interaction methods are called without explicitly calling this
2877      * method first, JWebUnit will attempt to determine itself which form is being manipulated.
2878      *
2879      * It is not necessary to call this method if their is only one form on the current page.
2880      *
2881      * @param nameOrId name or id of the form to work with.
2882      * @param index The 0-based index, when more than one form with the same name is expected.
2883      */
2884     public void setWorkingForm(String nameOrId, int index) {
2885         try {
2886             tester.setWorkingForm(nameOrId, index);
2887         } catch (org.junit.ComparisonFailure e) {
2888             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2889         } catch (java.lang.AssertionError e) {
2890             throw new junit.framework.AssertionFailedError(e.getMessage());
2891         }
2892     }
2893 
2894     /**
2895      * Set the value of a text or password input field.
2896      *
2897      * @param inputName name of form element.
2898      * @param value value to set.
2899      */
2900     public void setTextField(String inputName, String value) {
2901         try {
2902             tester.setTextField(inputName, value);
2903         } catch (org.junit.ComparisonFailure e) {
2904             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2905         } catch (java.lang.AssertionError e) {
2906             throw new junit.framework.AssertionFailedError(e.getMessage());
2907         }
2908     }
2909 
2910     /**
2911      * Set the value of an hidden input field.
2912      *
2913      * @param inputName name of form element.
2914      * @param value value to set.
2915      */
2916     public void setHiddenField(String inputName, String value) {
2917         try {
2918             tester.setHiddenField(inputName, value);
2919         } catch (org.junit.ComparisonFailure e) {
2920             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2921         } catch (java.lang.AssertionError e) {
2922             throw new junit.framework.AssertionFailedError(e.getMessage());
2923         }
2924     }
2925 
2926     /**
2927      * Select a specified checkbox. If the checkbox is already checked then the checkbox will stay checked.
2928      *
2929      * @param checkBoxName name of checkbox to be selected.
2930      */
2931     public void checkCheckbox(String checkBoxName) {
2932         try {
2933             tester.checkCheckbox(checkBoxName);
2934         } catch (org.junit.ComparisonFailure e) {
2935             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2936         } catch (java.lang.AssertionError e) {
2937             throw new junit.framework.AssertionFailedError(e.getMessage());
2938         }
2939     }
2940 
2941     /**
2942      * Select a specified checkbox. If the checkbox is already checked then the checkbox will stay checked.
2943      *
2944      * @param checkBoxName name of checkbox to be selected.
2945      * @param value value of checkbox to be selected.
2946      */
2947     public void checkCheckbox(String checkBoxName, String value) {
2948         try {
2949             tester.checkCheckbox(checkBoxName, value);
2950         } catch (org.junit.ComparisonFailure e) {
2951             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2952         } catch (java.lang.AssertionError e) {
2953             throw new junit.framework.AssertionFailedError(e.getMessage());
2954         }
2955     }
2956 
2957     /**
2958      * Deselect a specified checkbox. If the checkbox is already unchecked then the checkbox will stay unchecked.
2959      *
2960      * @param checkBoxName name of checkbox to be deselected.
2961      */
2962     public void uncheckCheckbox(String checkBoxName) {
2963         try {
2964             tester.uncheckCheckbox(checkBoxName);
2965         } catch (org.junit.ComparisonFailure e) {
2966             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2967         } catch (java.lang.AssertionError e) {
2968             throw new junit.framework.AssertionFailedError(e.getMessage());
2969         }
2970     }
2971 
2972     /**
2973      * Deselect a specified checkbox. If the checkbox is already unchecked then the checkbox will stay unchecked.
2974      *
2975      * @param checkBoxName name of checkbox to be deselected.
2976      * @param value value of checkbox to be deselected.
2977      */
2978     public void uncheckCheckbox(String checkBoxName, String value) {
2979         try {
2980             tester.uncheckCheckbox(checkBoxName, value);
2981         } catch (org.junit.ComparisonFailure e) {
2982             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2983         } catch (java.lang.AssertionError e) {
2984             throw new junit.framework.AssertionFailedError(e.getMessage());
2985         }
2986     }
2987 
2988     /**
2989      * Select options with given display labels in a select element.
2990      *
2991      * @param selectName name of select element.
2992      * @param labels labels of options to be selected.
2993      */
2994     public void selectOptions(String selectName, String[] labels) {
2995         try {
2996             tester.selectOptions(selectName, labels);
2997         } catch (org.junit.ComparisonFailure e) {
2998             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
2999         } catch (java.lang.AssertionError e) {
3000             throw new junit.framework.AssertionFailedError(e.getMessage());
3001         }
3002     }
3003 
3004     /**
3005      * Select an option with a given display label in a select element.
3006      *
3007      * @param selectName name of select element.
3008      * @param label label of option to be selected.
3009      */
3010     public void selectOption(String selectName, String label) {
3011         try {
3012             tester.selectOption(selectName, label);
3013         } catch (org.junit.ComparisonFailure e) {
3014             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3015         } catch (java.lang.AssertionError e) {
3016             throw new junit.framework.AssertionFailedError(e.getMessage());
3017         }
3018     }
3019 
3020     /**
3021      * Select an option with a given display label in Nth select element.
3022      *
3023      * @param selectName name of select element.
3024      * @param index the 0-based index of the select element when multiple
3025      * select elements are expected.
3026      * @param label label of option to be selected.
3027      */
3028     public void selectOption(String selectName, int index, String label) {
3029         try {
3030             tester.selectOption(selectName, index, label);
3031         } catch (org.junit.ComparisonFailure e) {
3032             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3033         } catch (java.lang.AssertionError e) {
3034             throw new junit.framework.AssertionFailedError(e.getMessage());
3035         }
3036     }
3037 
3038     /**
3039      * Select options with given display labels in the Nth select element.
3040      *
3041      * @param selectName name of select element.
3042      * @param index the 0-based index of the select element when multiple
3043      * select elements are expected.
3044      * @param labels labels of options to be selected.
3045      */
3046     public void selectOptions(String selectName, int index, String[] labels) {
3047         try {
3048             tester.selectOptions(selectName, index, labels);
3049         } catch (org.junit.ComparisonFailure e) {
3050             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3051         } catch (java.lang.AssertionError e) {
3052             throw new junit.framework.AssertionFailedError(e.getMessage());
3053         }
3054     }
3055 
3056     /**
3057      * Select options with given values in a select element.
3058      *
3059      * @param selectName name of select element.
3060      * @param values values of options to be selected.
3061      */
3062     public void selectOptionsByValues(String selectName, String[] values) {
3063         try {
3064             tester.selectOptionsByValues(selectName, values);
3065         } catch (org.junit.ComparisonFailure e) {
3066             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3067         } catch (java.lang.AssertionError e) {
3068             throw new junit.framework.AssertionFailedError(e.getMessage());
3069         }
3070     }
3071 
3072     /**
3073      * Select an option with a given value in the Nth select element.
3074      *
3075      * @param selectName name of select element.
3076      * @param index the 0-based index of the select element when multiple
3077      * select elements are expected.
3078      * @param values values of options to be selected.
3079      */
3080     public void selectOptionByValue(String selectName, String value) {
3081         try {
3082             tester.selectOptionByValue(selectName, value);
3083         } catch (org.junit.ComparisonFailure e) {
3084             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3085         } catch (java.lang.AssertionError e) {
3086             throw new junit.framework.AssertionFailedError(e.getMessage());
3087         }
3088     }
3089 
3090     /**
3091      * Select options with given values in the Nth select element.
3092      *
3093      * @param selectName name of select element.
3094      * @param index the 0-based index of the select element when multiple
3095      * select elements are expected.
3096      * @param values values of options to be selected.
3097      */
3098     public void selectOptionsByValues(String selectName, int index, String[] values) {
3099         try {
3100             tester.selectOptionsByValues(selectName, index, values);
3101         } catch (org.junit.ComparisonFailure e) {
3102             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3103         } catch (java.lang.AssertionError e) {
3104             throw new junit.framework.AssertionFailedError(e.getMessage());
3105         }
3106     }
3107 
3108     /**
3109      * Select an option with a given value in a select element.
3110      *
3111      * @param selectName name of select element.
3112      * @param values values of options to be selected.
3113      */
3114     public void selectOptionByValue(String selectName, int index, String value) {
3115         try {
3116             tester.selectOptionByValue(selectName, index, value);
3117         } catch (org.junit.ComparisonFailure e) {
3118             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3119         } catch (java.lang.AssertionError e) {
3120             throw new junit.framework.AssertionFailedError(e.getMessage());
3121         }
3122     }
3123 
3124     /**
3125      * Submit form - default submit button will be used (unnamed submit button, or named button if there is only one on
3126      * the form.
3127      */
3128     public void submit() {
3129         try {
3130             tester.submit();
3131         } catch (org.junit.ComparisonFailure e) {
3132             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3133         } catch (java.lang.AssertionError e) {
3134             throw new junit.framework.AssertionFailedError(e.getMessage());
3135         }
3136     }
3137 
3138     /**
3139      * Submit form by pressing named button.
3140      *
3141      * @param buttonName Submit button name attribut value.
3142      */
3143     public void submit(String buttonName) {
3144         try {
3145             tester.submit(buttonName);
3146         } catch (org.junit.ComparisonFailure e) {
3147             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3148         } catch (java.lang.AssertionError e) {
3149             throw new junit.framework.AssertionFailedError(e.getMessage());
3150         }
3151     }
3152 
3153     /**
3154      * Submit the form by pressing the named button with the given value (label). Useful if you have more than one
3155      * submit button with same name.
3156      *
3157      * @param buttonName Submit button name attribut value.
3158      * @param buttonValue Submit button value attribut value.
3159      */
3160     public void submit(String buttonName, String buttonValue) {
3161         try {
3162             tester.submit(buttonName, buttonValue);
3163         } catch (org.junit.ComparisonFailure e) {
3164             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3165         } catch (java.lang.AssertionError e) {
3166             throw new junit.framework.AssertionFailedError(e.getMessage());
3167         }
3168     }
3169 
3170     /**
3171      * Reset the current form using the default reset button. See {@link #getForm}for an explanation of how the current
3172      * form is established.
3173      */
3174     public void reset() {
3175         try {
3176             tester.reset();
3177         } catch (org.junit.ComparisonFailure e) {
3178             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3179         } catch (java.lang.AssertionError e) {
3180             throw new junit.framework.AssertionFailedError(e.getMessage());
3181         }
3182     }
3183 
3184     /**
3185      * Navigate by selection of a link containing given text.
3186      *
3187      * @param linkText Text in the link.
3188      */
3189     public void clickLinkWithText(String linkText) {
3190         try {
3191             tester.clickLinkWithText(linkText);
3192         } catch (org.junit.ComparisonFailure e) {
3193             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3194         } catch (java.lang.AssertionError e) {
3195             throw new junit.framework.AssertionFailedError(e.getMessage());
3196         }
3197     }
3198 
3199     /**
3200      * Navigate by selecting Nth link containing given text.
3201      *
3202      * @param linkText Text in the link.
3203      * @param index The 0-based index, when more than one link with the same text is expected.
3204      */
3205     public void clickLinkWithText(String linkText, int index) {
3206         try {
3207             tester.clickLinkWithText(linkText, index);
3208         } catch (org.junit.ComparisonFailure e) {
3209             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3210         } catch (java.lang.AssertionError e) {
3211             throw new junit.framework.AssertionFailedError(e.getMessage());
3212         }
3213     }
3214 
3215     /**
3216      * Navigate by selection of a link with the exact given text.
3217      *
3218      * @param linkText Text of the link.
3219      */
3220     public void clickLinkWithExactText(String linkText) {
3221         try {
3222             tester.clickLinkWithExactText(linkText);
3223         } catch (org.junit.ComparisonFailure e) {
3224             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3225         } catch (java.lang.AssertionError e) {
3226             throw new junit.framework.AssertionFailedError(e.getMessage());
3227         }
3228     }
3229 
3230     /**
3231      * Navigate by selecting Nth link with the exact given text.
3232      *
3233      * @param linkText Text of the link.
3234      * @param index The 0-based index, when more than one link with the same text is expected.
3235      */
3236     public void clickLinkWithExactText(String linkText, int index) {
3237         try {
3238             tester.clickLinkWithExactText(linkText, index);
3239         } catch (org.junit.ComparisonFailure e) {
3240             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3241         } catch (java.lang.AssertionError e) {
3242             throw new junit.framework.AssertionFailedError(e.getMessage());
3243         }
3244     }
3245 
3246     /**
3247      * Click the button with the given id.
3248      *
3249      * @param buttonId Button ID attribut value.
3250      */
3251     public void clickButton(String buttonId) {
3252         try {
3253             tester.clickButton(buttonId);
3254         } catch (org.junit.ComparisonFailure e) {
3255             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3256         } catch (java.lang.AssertionError e) {
3257             throw new junit.framework.AssertionFailedError(e.getMessage());
3258         }
3259     }
3260 
3261     /**
3262      * Clicks a button with <code>text</code> of the value attribute.
3263      *
3264      * @param buttonValueText The text of the button (contents of the value attribute).
3265      */
3266     public void clickButtonWithText(String buttonValueText) {
3267         try {
3268             tester.clickButtonWithText(buttonValueText);
3269         } catch (org.junit.ComparisonFailure e) {
3270             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3271         } catch (java.lang.AssertionError e) {
3272             throw new junit.framework.AssertionFailedError(e.getMessage());
3273         }
3274     }
3275 
3276     /**
3277      * Navigate by selection of a link with a given image.
3278      *
3279      * @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
3280      *            you could just pass in <tt>"my_icon.png"</tt>.
3281      */
3282     public void clickLinkWithImage(String imageFileName) {
3283         try {
3284             tester.clickLinkWithImage(imageFileName);
3285         } catch (org.junit.ComparisonFailure e) {
3286             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3287         } catch (java.lang.AssertionError e) {
3288             throw new junit.framework.AssertionFailedError(e.getMessage());
3289         }
3290     }
3291 
3292     /**
3293      * Navigate by selection of a link with a given image.
3294      *
3295      * @param imageFileName A suffix of the image's filename; for example, to match <tt>"images/my_icon.png"</tt>,
3296      *            you could just pass in <tt>"my_icon.png"</tt>.
3297      * @param index The 0-based index, when more than one link with the same image is expected.
3298      */
3299     public void clickLinkWithImage(String imageFileName, int index) {
3300         try {
3301             tester.clickLinkWithImage(imageFileName, index);
3302         } catch (org.junit.ComparisonFailure e) {
3303             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3304         } catch (java.lang.AssertionError e) {
3305             throw new junit.framework.AssertionFailedError(e.getMessage());
3306         }
3307     }
3308 
3309     /**
3310      * Navigate by selection of a link with given id.
3311      *
3312      * @param linkId id of link
3313      */
3314     public void clickLink(String linkId) {
3315         try {
3316             tester.clickLink(linkId);
3317         } catch (org.junit.ComparisonFailure e) {
3318             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3319         } catch (java.lang.AssertionError e) {
3320             throw new junit.framework.AssertionFailedError(e.getMessage());
3321         }
3322     }
3323 
3324     /**
3325      * Clicks a radio option. Asserts that the radio option exists first. *
3326      *
3327      * @param radioGroup name of the radio group.
3328      * @param radioOption value of the option to check for.
3329      */
3330     public void clickRadioOption(String radioGroup, String radioOption) {
3331         try {
3332             tester.clickRadioOption(radioGroup, radioOption);
3333         } catch (org.junit.ComparisonFailure e) {
3334             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3335         } catch (java.lang.AssertionError e) {
3336             throw new junit.framework.AssertionFailedError(e.getMessage());
3337         }
3338     }
3339 
3340     /**
3341      * Click element with given xpath.
3342      *
3343      * @param xpath xpath of the element.
3344      */
3345     public void clickElementByXPath(String xpath) {
3346         try {
3347             tester.clickElementByXPath(xpath);
3348         } catch (org.junit.ComparisonFailure e) {
3349             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3350         } catch (java.lang.AssertionError e) {
3351             throw new junit.framework.AssertionFailedError(e.getMessage());
3352         }
3353     }
3354 
3355     /**
3356      * Get the attribute value of the given element.
3357      * For example, if you have an element <code>&lt;img src="test.gif" alt="picture"&gt;</code>
3358      * getElementAttributeByXPath("//img[@src='test.gif']", "alt") returns "picture".
3359      *
3360      * @param xpath XPath of the element
3361      * @param attribute Name of the attribute
3362      * @return The value of the attribute
3363      */
3364     public String getElementAttributeByXPath(String xpath, String attribute) {
3365         try {
3366             return tester.getElementAttributeByXPath(xpath, attribute);
3367         } catch (org.junit.ComparisonFailure e) {
3368             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3369         } catch (java.lang.AssertionError e) {
3370             throw new junit.framework.AssertionFailedError(e.getMessage());
3371         }
3372     }
3373 
3374     /**
3375      * @deprecated Use {@link #getElementAttributeByXPath(String, String)}
3376      */
3377     public String getElementAttributByXPath(String xpath, String attribute) {
3378         try {
3379             return tester.getElementAttributByXPath(xpath, attribute);
3380         } catch (org.junit.ComparisonFailure e) {
3381             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3382         } catch (java.lang.AssertionError e) {
3383             throw new junit.framework.AssertionFailedError(e.getMessage());
3384         }
3385     }
3386 
3387     /**
3388      * Get text of the given element.
3389      *
3390      * @param xpath xpath of the element.
3391      */
3392     public String getElementTextByXPath(String xpath) {
3393         try {
3394             return tester.getElementTextByXPath(xpath);
3395         } catch (org.junit.ComparisonFailure e) {
3396             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3397         } catch (java.lang.AssertionError e) {
3398             throw new junit.framework.AssertionFailedError(e.getMessage());
3399         }
3400     }
3401 
3402     /**
3403      * Get an element for a particular xpath.
3404      *
3405      * @param xpath XPath to search
3406      * @return the requested element
3407    * @throws AssertionError if the element xpath is not found
3408      */
3409     public IElement getElementByXPath(String xpath) {
3410         try {
3411             return tester.getElementByXPath(xpath);
3412         } catch (org.junit.ComparisonFailure e) {
3413             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3414         } catch (java.lang.AssertionError e) {
3415             throw new junit.framework.AssertionFailedError(e.getMessage());
3416         }
3417     }
3418 
3419     /**
3420      * Return {@code true} if the given element by XPath exists.
3421      *
3422      * @param xpath XPath to search
3423      * @return {@code true} if the the requested element
3424      * @throws AssertionError if the element xpath is not found
3425      */
3426     public boolean hasElementByXPath(String xpath) {
3427         try {
3428             return tester.hasElementByXPath(xpath);
3429         } catch (org.junit.ComparisonFailure e) {
3430             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3431         } catch (java.lang.AssertionError e) {
3432             throw new junit.framework.AssertionFailedError(e.getMessage());
3433         }
3434     }
3435 
3436     /**
3437      * Get an element for a particular ID.
3438      *
3439      * @param id element ID to find
3440      * @return the requested element
3441    * @throws AssertionError if the element is not found
3442      */
3443     public IElement getElementById(String id) {
3444         try {
3445             return tester.getElementById(id);
3446         } catch (org.junit.ComparisonFailure e) {
3447             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3448         } catch (java.lang.AssertionError e) {
3449             throw new junit.framework.AssertionFailedError(e.getMessage());
3450         }
3451     }
3452 
3453     /**
3454      * Returns {@code true} if an element with the given ID exists.
3455      * 
3456      * @param id element ID to find
3457      * @return {@code true} if the element ID exists, {@code false} otherwise
3458      */
3459     public boolean hasElementById(String id) {
3460         try {
3461             return tester.hasElementById(id);
3462         } catch (org.junit.ComparisonFailure e) {
3463             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3464         } catch (java.lang.AssertionError e) {
3465             throw new junit.framework.AssertionFailedError(e.getMessage());
3466         }
3467     }
3468 
3469     /**
3470      * Get elements for a particular xpath.
3471      *
3472      * @param xpath XPath to search
3473      * @return the requested elements found
3474      */
3475     public List<IElement> getElementsByXPath(String xpath) {
3476         try {
3477             return tester.getElementsByXPath(xpath);
3478         } catch (org.junit.ComparisonFailure e) {
3479             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3480         } catch (java.lang.AssertionError e) {
3481             throw new junit.framework.AssertionFailedError(e.getMessage());
3482         }
3483     }
3484 
3485     /**
3486      * Return {@code true} if the given elements by XPath exists.
3487      *
3488      * @param xpath XPath to search
3489      * @return {@code true} if the given elements by XPath exist
3490      */
3491     public boolean hasElementsByXPath(String xpath) {
3492         try {
3493             return tester.hasElementsByXPath(xpath);
3494         } catch (org.junit.ComparisonFailure e) {
3495             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3496         } catch (java.lang.AssertionError e) {
3497             throw new junit.framework.AssertionFailedError(e.getMessage());
3498         }
3499     }
3500 
3501     /**
3502      * Assert a label for a given ID exists.
3503      */
3504     public void assertLabelPresent(String id) {
3505         try {
3506             tester.assertLabelPresent(id);
3507         } catch (org.junit.ComparisonFailure e) {
3508             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3509         } catch (java.lang.AssertionError e) {
3510             throw new junit.framework.AssertionFailedError(e.getMessage());
3511         }
3512     }
3513 
3514     /**
3515      * Assert a label exists.
3516      */
3517     public void assertLabelMatches(String regexp) {
3518         try {
3519             tester.assertLabelMatches(regexp);
3520         } catch (org.junit.ComparisonFailure e) {
3521             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3522         } catch (java.lang.AssertionError e) {
3523             throw new junit.framework.AssertionFailedError(e.getMessage());
3524         }
3525     }
3526 
3527     /**
3528      * Get all the fields of type <code>input</code>, <code>textarea</code> or <code>select</code>
3529      * that are referenced or contained in a particular label.
3530      *
3531      * @param label The label to consider
3532      * @return A list of all fields contained or referenced in this label
3533      */
3534     public List<IElement> getFieldsForLabel(IElement label) {
3535         try {
3536             return tester.getFieldsForLabel(label);
3537         } catch (org.junit.ComparisonFailure e) {
3538             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3539         } catch (java.lang.AssertionError e) {
3540             throw new junit.framework.AssertionFailedError(e.getMessage());
3541         }
3542     }
3543 
3544     /**
3545      * Get the current value of a given labelled field.
3546      *
3547      * @param identifier the HTML ID for the given labelled field
3548      * @param label the label found for the given HTML ID
3549      * @return the value found in a field for the given label/ID, or
3550      * 		<code>null</code> if none was found
3551      */
3552     public String getLabeledFieldValue(String identifier, IElement label) {
3553         try {
3554             return tester.getLabeledFieldValue(identifier, label);
3555         } catch (org.junit.ComparisonFailure e) {
3556             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3557         } catch (java.lang.AssertionError e) {
3558             throw new junit.framework.AssertionFailedError(e.getMessage());
3559         }
3560     }
3561 
3562     /**
3563      * Assert that a labeled field exists (for the given ID) and the
3564      * field that it labels equals the given text
3565      *
3566      * @param id the HTML ID for the given labelled field
3567      * @param fieldText the text that the field's value should equal
3568      * @see #getLabeledFieldValue(String, IElement, String)
3569      * @see #getLabel(String)
3570      */
3571     public void assertLabeledFieldEquals(String id, String fieldText) {
3572         try {
3573             tester.assertLabeledFieldEquals(id, fieldText);
3574         } catch (org.junit.ComparisonFailure e) {
3575             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3576         } catch (java.lang.AssertionError e) {
3577             throw new junit.framework.AssertionFailedError(e.getMessage());
3578         }
3579     }
3580 
3581     
3582     public void setLabeledFormElementField(String id, String value) {
3583         try {
3584             tester.setLabeledFormElementField(id, value);
3585         } catch (org.junit.ComparisonFailure e) {
3586             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3587         } catch (java.lang.AssertionError e) {
3588             throw new junit.framework.AssertionFailedError(e.getMessage());
3589         }
3590     }
3591 
3592     /**
3593      * Make a given window active.
3594      *
3595      * @param windowName Name of the window.
3596      */
3597     public void gotoWindow(String windowName) {
3598         try {
3599             tester.gotoWindow(windowName);
3600         } catch (org.junit.ComparisonFailure e) {
3601             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3602         } catch (java.lang.AssertionError e) {
3603             throw new junit.framework.AssertionFailedError(e.getMessage());
3604         }
3605     }
3606 
3607     /**
3608      * Make a given window active.
3609      *
3610      * @param windowID Javascript ID of the window
3611      * @deprecated Javascript ID does'nt not exists. Currently this is an index
3612      * in the list of available windows, but this is not portable (and probably not stable).
3613      * Use {@link #gotoWindow(String)} or {@link #gotoWindowByTitle(String)} instead.
3614      */
3615     @Deprecated
3616     public void gotoWindow(int windowID) {
3617         try {
3618             tester.gotoWindow(windowID);
3619         } catch (org.junit.ComparisonFailure e) {
3620             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3621         } catch (java.lang.AssertionError e) {
3622             throw new junit.framework.AssertionFailedError(e.getMessage());
3623         }
3624     }
3625 
3626     /**
3627      * Make the root window active. Used to reset the effect of {@link ITestingEngine#gotoFrame(String)}.
3628      */
3629     public void gotoRootWindow() {
3630         try {
3631             tester.gotoRootWindow();
3632         } catch (org.junit.ComparisonFailure e) {
3633             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3634         } catch (java.lang.AssertionError e) {
3635             throw new junit.framework.AssertionFailedError(e.getMessage());
3636         }
3637     }
3638 
3639     /**
3640      * Make first window with the given title active.
3641      *
3642      * @param title Title of the window.
3643      */
3644     public void gotoWindowByTitle(String title) {
3645         try {
3646             tester.gotoWindowByTitle(title);
3647         } catch (org.junit.ComparisonFailure e) {
3648             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3649         } catch (java.lang.AssertionError e) {
3650             throw new junit.framework.AssertionFailedError(e.getMessage());
3651         }
3652     }
3653 
3654     /**
3655      * Make the given frame active.
3656      *
3657      * @param frameNameOrId Name or ID of the frame. ID is checked first.
3658      */
3659     public void gotoFrame(String frameNameOrId) {
3660         try {
3661             tester.gotoFrame(frameNameOrId);
3662         } catch (org.junit.ComparisonFailure e) {
3663             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3664         } catch (java.lang.AssertionError e) {
3665             throw new junit.framework.AssertionFailedError(e.getMessage());
3666         }
3667     }
3668 
3669     /**
3670      * Go to the given page like if user has typed the URL manually in the browser. Use
3671      * {@link TestContext#setBaseUrl(String) getTestContext().setBaseUrl(String)} to define base URL. Absolute URL
3672      * should start with "http://", "https://" or "www.".
3673      *
3674      * @param url absolute or relative URL (relative to base URL).
3675      * @throws TestingEngineResponseException If something bad happend (404)
3676      */
3677     public void gotoPage(String url)throws TestingEngineResponseException {
3678         try {
3679             tester.gotoPage(url);
3680         } catch (org.junit.ComparisonFailure e) {
3681             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3682         } catch (java.lang.AssertionError e) {
3683             throw new junit.framework.AssertionFailedError(e.getMessage());
3684         }
3685     }
3686 
3687     /**
3688      * Print all the cookies to stdout.
3689      *
3690      */
3691     public void dumpCookies() {
3692         try {
3693             tester.dumpCookies();
3694         } catch (org.junit.ComparisonFailure e) {
3695             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3696         } catch (java.lang.AssertionError e) {
3697             throw new junit.framework.AssertionFailedError(e.getMessage());
3698         }
3699     }
3700 
3701     /**
3702      * Get the source of the HTML page (like in a real browser), or HTTP body for a non HTML content.
3703      *
3704      * @return The HTML content.
3705      */
3706     public String getPageSource() {
3707         try {
3708             return tester.getPageSource();
3709         } catch (org.junit.ComparisonFailure e) {
3710             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3711         } catch (java.lang.AssertionError e) {
3712             throw new junit.framework.AssertionFailedError(e.getMessage());
3713         }
3714     }
3715 
3716     /**
3717      * Get the last data sent by the server.
3718      *
3719      * @return HTTP server response.
3720      */
3721     public String getServerResponse() {
3722         try {
3723             return tester.getServerResponse();
3724         } catch (org.junit.ComparisonFailure e) {
3725             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3726         } catch (java.lang.AssertionError e) {
3727             throw new junit.framework.AssertionFailedError(e.getMessage());
3728         }
3729     }
3730 
3731     /**
3732      * @deprecated use {@link #getServerResponse()}
3733      * @return
3734      */
3735     public String getServeurResponse() {
3736         try {
3737             return tester.getServeurResponse();
3738         } catch (org.junit.ComparisonFailure e) {
3739             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3740         } catch (java.lang.AssertionError e) {
3741             throw new junit.framework.AssertionFailedError(e.getMessage());
3742         }
3743     }
3744 
3745     /**
3746      * Save the last downloaded page (or file) to the disk.
3747      *
3748      * @param f The file name.
3749      */
3750     public void saveAs(File f) {
3751         try {
3752             tester.saveAs(f);
3753         } catch (org.junit.ComparisonFailure e) {
3754             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3755         } catch (java.lang.AssertionError e) {
3756             throw new junit.framework.AssertionFailedError(e.getMessage());
3757         }
3758     }
3759 
3760     /**
3761      * Download the current page (or file) and compare it with the given file.
3762      *
3763      * @param expected Expected file URL.
3764      */
3765     public void assertDownloadedFileEquals(URL expected) {
3766         try {
3767             tester.assertDownloadedFileEquals(expected);
3768         } catch (org.junit.ComparisonFailure e) {
3769             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3770         } catch (java.lang.AssertionError e) {
3771             throw new junit.framework.AssertionFailedError(e.getMessage());
3772         }
3773     }
3774 
3775     /**
3776      * Dump html of current response to System.out - for debugging purposes.
3777      *
3778      * @param stream
3779      * @deprecated Use {@link WebTester#getPageSource()}
3780      */
3781     public void dumpHtml() {
3782         try {
3783             tester.dumpHtml();
3784         } catch (org.junit.ComparisonFailure e) {
3785             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3786         } catch (java.lang.AssertionError e) {
3787             throw new junit.framework.AssertionFailedError(e.getMessage());
3788         }
3789     }
3790 
3791     /**
3792      * Dump html of current response to a specified stream - for debugging purposes.
3793      *
3794      * @param stream
3795      * @deprecated Use {@link WebTester#getPageSource()}
3796      */
3797     public void dumpHtml(PrintStream stream) {
3798         try {
3799             tester.dumpHtml(stream);
3800         } catch (org.junit.ComparisonFailure e) {
3801             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3802         } catch (java.lang.AssertionError e) {
3803             throw new junit.framework.AssertionFailedError(e.getMessage());
3804         }
3805     }
3806 
3807     /**
3808      * Dump the table as the 2D array that is used for assertions - for debugging purposes.
3809      *
3810      * @param tableNameOrId
3811      * @param stream
3812      */
3813     public void dumpTable(String tableNameOrId) {
3814         try {
3815             tester.dumpTable(tableNameOrId);
3816         } catch (org.junit.ComparisonFailure e) {
3817             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3818         } catch (java.lang.AssertionError e) {
3819             throw new junit.framework.AssertionFailedError(e.getMessage());
3820         }
3821     }
3822 
3823     /**
3824      * Dump the table as the 2D array that is used for assertions - for debugging purposes.
3825      *
3826      * @param tableNameOrId
3827      * @param table
3828      * @param stream
3829      */
3830     public void dumpTable(String tableNameOrId, PrintStream stream) {
3831         try {
3832             tester.dumpTable(tableNameOrId, stream);
3833         } catch (org.junit.ComparisonFailure e) {
3834             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3835         } catch (java.lang.AssertionError e) {
3836             throw new junit.framework.AssertionFailedError(e.getMessage());
3837         }
3838     }
3839 
3840     /**
3841      * Enable or disable Javascript support
3842      */
3843     public void setScriptingEnabled(boolean value) {
3844         try {
3845             tester.setScriptingEnabled(value);
3846         } catch (org.junit.ComparisonFailure e) {
3847             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3848         } catch (java.lang.AssertionError e) {
3849             throw new junit.framework.AssertionFailedError(e.getMessage());
3850         }
3851     }
3852 
3853     /**
3854      * Set the Testing Engine that you want to use for the tests based on the Testing Engine Key.
3855      *
3856      * @see TestingEngineRegistry
3857      * @param testingEngineKey The testingEngineKey to set.
3858      */
3859     public void setTestingEngineKey(String testingEngineKey) {
3860         try {
3861             tester.setTestingEngineKey(testingEngineKey);
3862         } catch (org.junit.ComparisonFailure e) {
3863             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3864         } catch (java.lang.AssertionError e) {
3865             throw new junit.framework.AssertionFailedError(e.getMessage());
3866         }
3867     }
3868 
3869     /**
3870      * Gets the Testing Engine Key that is used to find the proper testing engine class (HtmlUnitDialog /
3871      * SeleniumDialog) for the tests.
3872      *
3873      * @return Returns the testingEngineKey.
3874      */
3875     public String getTestingEngineKey() {
3876         try {
3877             return tester.getTestingEngineKey();
3878         } catch (org.junit.ComparisonFailure e) {
3879             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3880         } catch (java.lang.AssertionError e) {
3881             throw new junit.framework.AssertionFailedError(e.getMessage());
3882         }
3883     }
3884 
3885     /**
3886      * Set the value of a form input element.
3887      *
3888      * @param formElementName name of form element.
3889      * @param value
3890      * @see #setTextField(String, String)
3891      * @deprecated use {@link #setTextField(String, String)} or other methods
3892      */
3893     public void setFormElement(String formElementName, String value) {
3894         try {
3895             tester.setFormElement(formElementName, value);
3896         } catch (org.junit.ComparisonFailure e) {
3897             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3898         } catch (java.lang.AssertionError e) {
3899             throw new junit.framework.AssertionFailedError(e.getMessage());
3900         }
3901     }
3902 
3903     /**
3904      * Tell that the given alert box is expected.
3905      *
3906      * @param message Message in the alert.
3907      */
3908     public void setExpectedJavaScriptAlert(String message) {
3909         try {
3910             tester.setExpectedJavaScriptAlert(message);
3911         } catch (org.junit.ComparisonFailure e) {
3912             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3913         } catch (java.lang.AssertionError e) {
3914             throw new junit.framework.AssertionFailedError(e.getMessage());
3915         }
3916     }
3917 
3918     /**
3919      * Tell that the given alert boxes are expected in the given order.
3920      *
3921      * @param messages Messages in the alerts.
3922      */
3923     public void setExpectedJavaScriptAlert(String[] messages) {
3924         try {
3925             tester.setExpectedJavaScriptAlert(messages);
3926         } catch (org.junit.ComparisonFailure e) {
3927             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3928         } catch (java.lang.AssertionError e) {
3929             throw new junit.framework.AssertionFailedError(e.getMessage());
3930         }
3931     }
3932 
3933     /**
3934      * Tell that the given confirm boxe is expected.
3935      *
3936      * @param message Message in the confirm.
3937      * @param action Whether we should click on "OK" (true) or "Cancel" (false)
3938      */
3939     public void setExpectedJavaScriptConfirm(String message, boolean action) {
3940         try {
3941             tester.setExpectedJavaScriptConfirm(message, action);
3942         } catch (org.junit.ComparisonFailure e) {
3943             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3944         } catch (java.lang.AssertionError e) {
3945             throw new junit.framework.AssertionFailedError(e.getMessage());
3946         }
3947     }
3948 
3949     /**
3950      * Tell that the given confirm boxes are expected in the given order.
3951      *
3952      * @param messages Messages in the confirms.
3953      * @param actions Whether we should click on "OK" (true) or "Cancel" (false)
3954      */
3955     public void setExpectedJavaScriptConfirm(String[] messages, boolean[] actions) {
3956         try {
3957             tester.setExpectedJavaScriptConfirm(messages, actions);
3958         } catch (org.junit.ComparisonFailure e) {
3959             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3960         } catch (java.lang.AssertionError e) {
3961             throw new junit.framework.AssertionFailedError(e.getMessage());
3962         }
3963     }
3964 
3965     /**
3966      * Tell that the given prompt boxe is expected.
3967      *
3968      * @param message Message in the prompt.
3969      * @param input What we should put in the prompt (null if user press Cancel)
3970      */
3971     public void setExpectedJavaScriptPrompt(String message, String input) {
3972         try {
3973             tester.setExpectedJavaScriptPrompt(message, input);
3974         } catch (org.junit.ComparisonFailure e) {
3975             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3976         } catch (java.lang.AssertionError e) {
3977             throw new junit.framework.AssertionFailedError(e.getMessage());
3978         }
3979     }
3980 
3981     /**
3982      * Tell that the given prompt boxes are expected in the given order.
3983      *
3984      * @param messages Messages in the prompts.
3985      * @param inputs What we should put in the prompt (null if user press Cancel)
3986      */
3987     public void setExpectedJavaScriptPrompt(String[] messages, String[] inputs) {
3988         try {
3989             tester.setExpectedJavaScriptPrompt(messages, inputs);
3990         } catch (org.junit.ComparisonFailure e) {
3991             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
3992         } catch (java.lang.AssertionError e) {
3993             throw new junit.framework.AssertionFailedError(e.getMessage());
3994         }
3995     }
3996 
3997     /**
3998      * Assert there is at least one image in the page with given src and (optional) alt attributes.
3999      * @param imageSrc Value of image src attribute.
4000      * @param imageAlt Value of image alt attribute. Ignored when null.
4001      */
4002     public void assertImagePresent(String imageSrc, String imageAlt) {
4003         try {
4004             tester.assertImagePresent(imageSrc, imageAlt);
4005         } catch (org.junit.ComparisonFailure e) {
4006             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
4007         } catch (java.lang.AssertionError e) {
4008             throw new junit.framework.AssertionFailedError(e.getMessage());
4009         }
4010     }
4011 
4012     /**
4013      * Assert there is at least one image in the page with given partial src and (optional) partial alt attributes.
4014      * @param partialImageSrc
4015      * @param partialImageAlt
4016      */
4017     public void assertImagePresentPartial(String partialImageSrc, String partialImageAlt) {
4018         try {
4019             tester.assertImagePresentPartial(partialImageSrc, partialImageAlt);
4020         } catch (org.junit.ComparisonFailure e) {
4021             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
4022         } catch (java.lang.AssertionError e) {
4023             throw new junit.framework.AssertionFailedError(e.getMessage());
4024         }
4025     }
4026 
4027     /**
4028      * @see #assertImageValidAndStore(String, String, java.io.File)
4029      */
4030     public void assertImageValid(String imageSrc, String imageAlt) {
4031         try {
4032             tester.assertImageValid(imageSrc, imageAlt);
4033         } catch (org.junit.ComparisonFailure e) {
4034             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
4035         } catch (java.lang.AssertionError e) {
4036             throw new junit.framework.AssertionFailedError(e.getMessage());
4037         }
4038     }
4039 
4040     /**
4041      * Asserts that the image with the given src and alt attribute values exist in the page and is an actual reachable
4042      * image, then saves it as png with the given file name.
4043      *
4044      * @param imageSrc as it appears in the html page, i.e. relative to the current page.
4045      */
4046     public void assertImageValidAndStore(String imageSrc, String imageAlt, File out) {
4047         try {
4048             tester.assertImageValidAndStore(imageSrc, imageAlt, out);
4049         } catch (org.junit.ComparisonFailure e) {
4050             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
4051         } catch (java.lang.AssertionError e) {
4052             throw new junit.framework.AssertionFailedError(e.getMessage());
4053         }
4054     }
4055 
4056     /**
4057      * @see #assertImageValidAndStore(String, String, java.io.File)
4058      */
4059     public Image getImage(String imageSrc, String imageAlt) {
4060         try {
4061             return tester.getImage(imageSrc, imageAlt);
4062         } catch (org.junit.ComparisonFailure e) {
4063             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
4064         } catch (java.lang.AssertionError e) {
4065             throw new junit.framework.AssertionFailedError(e.getMessage());
4066         }
4067     }
4068 
4069     /**
4070      * Set the timeout for the request. A timeout of 0 means
4071      * an infinite timeout.
4072      *
4073      * @param milli the milliseconds in which to timeout, or 0 for infinite
4074      * wait (the default).
4075      */
4076     public void setTimeout(int milli) {
4077         try {
4078             tester.setTimeout(milli);
4079         } catch (org.junit.ComparisonFailure e) {
4080             throw new junit.framework.ComparisonFailure(e.getMessage(), e.getExpected(), e.getActual());
4081         } catch (java.lang.AssertionError e) {
4082             throw new junit.framework.AssertionFailedError(e.getMessage());
4083         }
4084     }
4085 
4086 }