View Javadoc
1   /*
2    * Copyright (c) 2002-2025 Gargoyle Software Inc.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    * https://www.apache.org/licenses/LICENSE-2.0
8    *
9    * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */
15  package org.htmlunit;
16  
17  import java.net.URL;
18  
19  import org.htmlunit.junit.BrowserRunner;
20  import org.htmlunit.junit.annotation.Alerts;
21  import org.junit.Test;
22  import org.junit.runner.RunWith;
23  import org.openqa.selenium.By;
24  import org.openqa.selenium.WebDriver;
25  
26  /**
27   * Tests for page reloading in various situations.
28   *
29   * @author Ronald Brill
30   * @author Frank Danek
31   */
32  @RunWith(BrowserRunner.class)
33  public class PageReloadTest extends WebDriverTestCase {
34  
35      private static final String ANCHOR = "#anchor";
36      private static final String ANCHOR2 = "#anchor2";
37      private static final String PATHNAME = "/reload.html";
38      private static final String PATHNAME2 = "/reload2.html";
39      private static final String RELOAD_URL = "http://localhost:" + PORT + PATHNAME;
40      private static final String RELOAD2_URL = "http://localhost:" + PORT + PATHNAME2;
41      private static final String RELOAD_URL_ANCHOR = RELOAD_URL + ANCHOR;
42  
43      /**
44       * @exception Exception If the test fails
45       */
46      @Test
47      @Alerts(PATHNAME)
48      public void link_url_emptyUrl() throws Exception {
49          openUrlAndClickById(RELOAD_URL, "linkEmpty", 1, getExpectedAlerts()[0], "");
50      }
51  
52      /**
53       * @exception Exception If the test fails
54       */
55      @Test
56      @Alerts("")
57      public void link_url_emptyHash() throws Exception {
58          openUrlAndClickById(RELOAD_URL, "linkEmptyHash", 0, PATHNAME, getExpectedAlerts()[0]);
59      }
60  
61      /**
62       * @exception Exception If the test fails
63       */
64      @Test
65      public void link_url_hash() throws Exception {
66          openUrlAndClickById(RELOAD_URL, "linkHash", 0, PATHNAME, ANCHOR);
67      }
68  
69      /**
70       * @exception Exception If the test fails
71       */
72      @Test
73      public void link_url_differentHash() throws Exception {
74          openUrlAndClickById(RELOAD_URL, "linkDifferentHash", 0, PATHNAME, ANCHOR2);
75      }
76  
77      /**
78       * @exception Exception If the test fails
79       */
80      @Test
81      public void link_url_url() throws Exception {
82          openUrlAndClickById(RELOAD_URL, "linkUrl", 1, PATHNAME, "");
83      }
84  
85      /**
86       * @exception Exception If the test fails
87       */
88      @Test
89      public void link_url_urlHash() throws Exception {
90          openUrlAndClickById(RELOAD_URL, "linkUrlHash", 0, PATHNAME, ANCHOR);
91      }
92  
93      /**
94       * @exception Exception If the test fails
95       */
96      @Test
97      public void link_url_differentUrl() throws Exception {
98          openUrlAndClickById(RELOAD_URL, "linkDifferentUrl", 1, PATHNAME2, "");
99      }
100 
101     /**
102      * @exception Exception If the test fails
103      */
104     @Test
105     @Alerts("")
106     public void link_url_differentUrlEmptyHash() throws Exception {
107         openUrlAndClickById(RELOAD_URL, "linkDifferentUrlEmptyHash", 1, PATHNAME2, getExpectedAlerts()[0]);
108     }
109 
110     /**
111      * @exception Exception If the test fails
112      */
113     @Test
114     public void link_url_differentUrlHash() throws Exception {
115         openUrlAndClickById(RELOAD_URL, "linkDifferentUrlHash", 1, PATHNAME2, ANCHOR);
116     }
117 
118     /**
119      * @exception Exception If the test fails
120      */
121     @Test
122     public void link_url_differentUrlDifferentHash() throws Exception {
123         openUrlAndClickById(RELOAD_URL, "linkDifferentUrlDifferentHash", 1, PATHNAME2, ANCHOR2);
124     }
125 
126     /**
127      * @exception Exception If the test fails
128      */
129     @Test
130     @Alerts(PATHNAME)
131     public void link_urlHash_emptyUrl() throws Exception {
132         openUrlAndClickById(URL_FIRST + "reload.html#anchor", "linkEmpty", 1, getExpectedAlerts()[0], "");
133     }
134 
135     /**
136      * @exception Exception If the test fails
137      */
138     @Test
139     public void link_urlHash_hash() throws Exception {
140         openUrlAndClickById(RELOAD_URL_ANCHOR, "linkHash", 0, PATHNAME, ANCHOR);
141     }
142 
143     /**
144      * @exception Exception If the test fails
145      */
146     @Test
147     public void link_urlHash_differentHash() throws Exception {
148         openUrlAndClickById(RELOAD_URL_ANCHOR, "linkDifferentHash", 0, PATHNAME, ANCHOR2);
149     }
150 
151     /**
152      * @exception Exception If the test fails
153      */
154     @Test
155     public void link_urlHash_url() throws Exception {
156         openUrlAndClickById(RELOAD_URL_ANCHOR, "linkUrl", 1, PATHNAME, "");
157     }
158 
159     /**
160      * @exception Exception If the test fails
161      */
162     @Test
163     public void link_urlHash_urlHash() throws Exception {
164         openUrlAndClickById(RELOAD_URL_ANCHOR, "linkUrlHash", 0, PATHNAME, ANCHOR);
165     }
166 
167     /**
168      * @exception Exception If the test fails
169      */
170     @Test
171     public void link_urlHash_differentUrl() throws Exception {
172         openUrlAndClickById(RELOAD_URL_ANCHOR, "linkDifferentUrl", 1, PATHNAME2, "");
173     }
174 
175     /**
176      * @exception Exception If the test fails
177      */
178     @Test
179     @Alerts("")
180     public void link_urlHash_differentUrlEmptyHash() throws Exception {
181         openUrlAndClickById(RELOAD_URL_ANCHOR, "linkDifferentUrlEmptyHash", 1, PATHNAME2, getExpectedAlerts()[0]);
182     }
183 
184     /**
185      * @exception Exception If the test fails
186      */
187     @Test
188     public void link_urlHash_differentUrlHash() throws Exception {
189         openUrlAndClickById(RELOAD_URL_ANCHOR, "linkDifferentUrlHash", 1, PATHNAME2, ANCHOR);
190     }
191 
192     /**
193      * @exception Exception If the test fails
194      */
195     @Test
196     public void link_urlHash_differentUrlDifferentHash() throws Exception {
197         openUrlAndClickById(RELOAD_URL_ANCHOR, "linkDifferentUrlDifferentHash", 1, PATHNAME2, ANCHOR2);
198     }
199 
200     /**
201      * @exception Exception If the test fails
202      */
203     @Test
204     @Alerts(PATHNAME)
205     public void javascript_url_emptyUrl() throws Exception {
206         openUrlAndClickById(RELOAD_URL, "javascriptEmpty", 1, getExpectedAlerts()[0], "");
207     }
208 
209     /**
210      * @exception Exception If the test fails
211      */
212     @Test
213     @Alerts("")
214     public void javascript_url_emptyHash() throws Exception {
215         openUrlAndClickById(RELOAD_URL, "javascriptEmptyHash", 0, PATHNAME, getExpectedAlerts()[0]);
216     }
217 
218     /**
219      * @exception Exception If the test fails
220      */
221     @Test
222     public void javascript_url_hash() throws Exception {
223         openUrlAndClickById(RELOAD_URL, "javascriptHash", 0, PATHNAME, ANCHOR);
224     }
225 
226     /**
227      * @exception Exception If the test fails
228      */
229     @Test
230     public void javascript_url_differentHash() throws Exception {
231         openUrlAndClickById(RELOAD_URL, "javascriptDifferentHash", 0, PATHNAME, ANCHOR2);
232     }
233 
234     /**
235      * @exception Exception If the test fails
236      */
237     @Test
238     public void javascript_url_url() throws Exception {
239         openUrlAndClickById(RELOAD_URL, "javascriptUrl", 1, PATHNAME, "");
240     }
241 
242     /**
243      * @exception Exception If the test fails
244      */
245     @Test
246     public void javascript_url_urlHash() throws Exception {
247         openUrlAndClickById(RELOAD_URL, "javascriptUrlHash", 0, PATHNAME, ANCHOR);
248     }
249 
250     /**
251      * @exception Exception If the test fails
252      */
253     @Test
254     public void javascript_url_differentUrl() throws Exception {
255         openUrlAndClickById(RELOAD_URL, "javascriptDifferentUrl", 1, PATHNAME2, "");
256     }
257 
258     /**
259      * @exception Exception If the test fails
260      */
261     @Test
262     @Alerts("")
263     public void javascript_url_differentUrlEmptyHash() throws Exception {
264         openUrlAndClickById(RELOAD_URL, "javascriptDifferentUrlEmptyHash", 1, PATHNAME2, getExpectedAlerts()[0]);
265     }
266 
267     /**
268      * @exception Exception If the test fails
269      */
270     @Test
271     public void javascript_url_differentUrlHash() throws Exception {
272         openUrlAndClickById(RELOAD_URL, "javascriptDifferentUrlHash", 1, PATHNAME2, ANCHOR);
273     }
274 
275     /**
276      * @exception Exception If the test fails
277      */
278     @Test
279     public void javascript_url_differentUrlDifferentHash() throws Exception {
280         openUrlAndClickById(RELOAD_URL, "javascriptDifferentUrlDifferentHash", 1, PATHNAME2, ANCHOR2);
281     }
282 
283     /**
284      * @exception Exception If the test fails
285      */
286     @Test
287     @Alerts(PATHNAME)
288     public void javascript_urlHash_emptyUrl() throws Exception {
289         openUrlAndClickById(URL_FIRST + "reload.html#anchor", "javascriptEmpty", 1, getExpectedAlerts()[0], "");
290     }
291 
292     /**
293      * @exception Exception If the test fails
294      */
295     @Test
296     public void javascript_urlHash_hash() throws Exception {
297         openUrlAndClickById(RELOAD_URL_ANCHOR, "javascriptHash", 0, PATHNAME, ANCHOR);
298     }
299 
300     /**
301      * @exception Exception If the test fails
302      */
303     @Test
304     public void javascript_urlHash_differentHash() throws Exception {
305         openUrlAndClickById(RELOAD_URL_ANCHOR, "javascriptDifferentHash", 0, PATHNAME, ANCHOR2);
306     }
307 
308     /**
309      * @exception Exception If the test fails
310      */
311     @Test
312     public void javascript_urlHash_url() throws Exception {
313         openUrlAndClickById(RELOAD_URL_ANCHOR, "javascriptUrl", 1, PATHNAME, "");
314     }
315 
316     /**
317      * @exception Exception If the test fails
318      */
319     @Test
320     public void javascript_urlHash_urlHash() throws Exception {
321         openUrlAndClickById(RELOAD_URL_ANCHOR, "javascriptUrlHash", 0, PATHNAME, ANCHOR);
322     }
323 
324     /**
325      * @exception Exception If the test fails
326      */
327     @Test
328     public void javascript_urlHash_differentUrl() throws Exception {
329         openUrlAndClickById(RELOAD_URL_ANCHOR, "javascriptDifferentUrl", 1, PATHNAME2, "");
330     }
331 
332     /**
333      * @exception Exception If the test fails
334      */
335     @Test
336     @Alerts("")
337     public void javascript_urlHash_differentUrlEmptyHash() throws Exception {
338         openUrlAndClickById(RELOAD_URL_ANCHOR, "javascriptDifferentUrlEmptyHash", 1, PATHNAME2, getExpectedAlerts()[0]);
339     }
340 
341     /**
342      * @exception Exception If the test fails
343      */
344     @Test
345     public void javascript_urlHash_differentUrlHash() throws Exception {
346         openUrlAndClickById(RELOAD_URL_ANCHOR, "javascriptDifferentUrlHash", 1, PATHNAME2, ANCHOR);
347     }
348 
349     /**
350      * @exception Exception If the test fails
351      */
352     @Test
353     public void submitGet_url_emptyUrl() throws Exception {
354         openUrlAndClickById(RELOAD_URL, "submitGetEmpty", 1, PATHNAME, "");
355     }
356 
357     /**
358      * @exception Exception If the test fails
359      */
360     @Test
361     public void submitGetV_url_emptyUrl() throws Exception {
362         openUrlAndClickById(RELOAD_URL, "submitGetEmptyV", 1, PATHNAME, "");
363     }
364 
365     /**
366      * @exception Exception If the test fails
367      */
368     @Test
369     @Alerts("1")
370     public void submitGet_url_emptyHash() throws Exception {
371         openUrlAndClickById(RELOAD_URL, "submitGetEmptyHash", Integer.parseInt(getExpectedAlerts()[0]), PATHNAME, "");
372     }
373 
374     /**
375      * @exception Exception If the test fails
376      */
377     @Test
378     public void submitGetV_url_emptyHash() throws Exception {
379         openUrlAndClickById(RELOAD_URL, "submitGetEmptyHashV", 1, PATHNAME, "");
380     }
381 
382     /**
383      * @exception Exception If the test fails
384      */
385     @Test
386     @Alerts({"1", ANCHOR})
387     public void submitGet_url_hash() throws Exception {
388         openUrlAndClickById(RELOAD_URL, "submitGetHash", Integer.parseInt(getExpectedAlerts()[0]),
389                 PATHNAME, getExpectedAlerts()[1]);
390     }
391 
392     /**
393      * @exception Exception If the test fails
394      */
395     @Test
396     @Alerts(ANCHOR)
397     public void submitGetV_url_hash() throws Exception {
398         openUrlAndClickById(RELOAD_URL, "submitGetHashV", 1,
399                 PATHNAME, getExpectedAlerts()[0]);
400     }
401 
402     /**
403      * @exception Exception If the test fails
404      */
405     @Test
406     @Alerts({"1", ANCHOR2 })
407     public void submitGet_url_differentHash() throws Exception {
408         openUrlAndClickById(RELOAD_URL, "submitGetDifferentHash", Integer.parseInt(getExpectedAlerts()[0]),
409                 PATHNAME, getExpectedAlerts()[1]);
410     }
411 
412     /**
413      * @exception Exception If the test fails
414      */
415     @Test
416     @Alerts(ANCHOR2)
417     public void submitGetV_url_differentHash() throws Exception {
418         openUrlAndClickById(RELOAD_URL, "submitGetDifferentHashV", 1, PATHNAME, getExpectedAlerts()[0]);
419     }
420 
421     /**
422      * @exception Exception If the test fails
423      */
424     @Test
425     public void submitGet_url_url() throws Exception {
426         openUrlAndClickById(RELOAD_URL, "submitGetUrl", 1, PATHNAME, "");
427     }
428 
429     /**
430      * @exception Exception If the test fails
431      */
432     @Test
433     public void submitGetV_url_url() throws Exception {
434         openUrlAndClickById(RELOAD_URL, "submitGetUrlV", 1, PATHNAME, "");
435     }
436 
437     /**
438      * @exception Exception If the test fails
439      */
440     @Test
441     @Alerts({"1", ANCHOR})
442     public void submitGet_url_urlHash() throws Exception {
443         openUrlAndClickById(RELOAD_URL, "submitGetUrlHash", Integer.parseInt(getExpectedAlerts()[0]),
444                 PATHNAME, getExpectedAlerts()[1]);
445     }
446 
447     /**
448      * @exception Exception If the test fails
449      */
450     @Test
451     @Alerts(ANCHOR)
452     public void submitGetV_url_urlHash() throws Exception {
453         openUrlAndClickById(RELOAD_URL, "submitGetUrlHashV", 1, PATHNAME, getExpectedAlerts()[0]);
454     }
455 
456     /**
457      * @exception Exception If the test fails
458      */
459     @Test
460     public void submitGet_url_differentUrl() throws Exception {
461         openUrlAndClickById(RELOAD_URL, "submitGetDifferentUrl", 1, PATHNAME2, "");
462     }
463 
464     /**
465      * @exception Exception If the test fails
466      */
467     @Test
468     public void submitGetV_url_differentUrl() throws Exception {
469         openUrlAndClickById(RELOAD_URL, "submitGetDifferentUrlV", 1, PATHNAME2, "");
470     }
471 
472     /**
473      * @exception Exception If the test fails
474      */
475     @Test
476     public void submitGet_url_differentUrlEmptyHash() throws Exception {
477         openUrlAndClickById(RELOAD_URL, "submitGetDifferentUrlEmptyHash", 1, PATHNAME2, "");
478     }
479 
480     /**
481      * @exception Exception If the test fails
482      */
483     @Test
484     @Alerts(ANCHOR)
485     public void submitGet_url_differentUrlHash() throws Exception {
486         openUrlAndClickById(RELOAD_URL, "submitGetDifferentUrlHash", 1,
487                 PATHNAME2, getExpectedAlerts()[0]);
488     }
489 
490     /**
491      * @exception Exception If the test fails
492      */
493     @Test
494     public void submitGetV_url_differentUrlEmptyHash() throws Exception {
495         openUrlAndClickById(RELOAD_URL, "submitGetDifferentUrlEmptyHashV", 1, PATHNAME2, "");
496     }
497 
498     /**
499      * @exception Exception If the test fails
500      */
501     @Test
502     @Alerts(ANCHOR)
503     public void submitGetV_url_differentUrlHash() throws Exception {
504         openUrlAndClickById(RELOAD_URL, "submitGetDifferentUrlHashV", 1,
505                 PATHNAME2, getExpectedAlerts()[0]);
506     }
507 
508     /**
509      * @exception Exception If the test fails
510      */
511     @Test
512     @Alerts(ANCHOR2)
513     public void submitGet_url_differentUrlDifferentHash() throws Exception {
514         openUrlAndClickById(RELOAD_URL, "submitGetDifferentUrlDifferentHash", 1, PATHNAME2, getExpectedAlerts()[0]);
515     }
516 
517     /**
518      * @exception Exception If the test fails
519      */
520     @Test
521     @Alerts(ANCHOR2)
522     public void submitGetV_url_differentUrlDifferentHash() throws Exception {
523         openUrlAndClickById(RELOAD_URL, "submitGetDifferentUrlDifferentHashV", 1, PATHNAME2, getExpectedAlerts()[0]);
524     }
525 
526     /**
527      * @exception Exception If the test fails
528      */
529     @Test
530     @Alerts({"1", ANCHOR})
531     public void submitGet_urlHash_emptyUrl() throws Exception {
532         openUrlAndClickById(URL_FIRST + "reload.html#anchor", "submitGetEmpty",
533                 Integer.parseInt(getExpectedAlerts()[0]),
534                 PATHNAME, getExpectedAlerts()[1]);
535     }
536 
537     /**
538      * @exception Exception If the test fails
539      */
540     @Test
541     @Alerts(ANCHOR)
542     public void submitGetV_urlHash_emptyUrl() throws Exception {
543         openUrlAndClickById(URL_FIRST + "reload.html#anchor", "submitGetEmptyV",
544                 1, PATHNAME, getExpectedAlerts()[0]);
545     }
546 
547     /**
548      * @exception Exception If the test fails
549      */
550     @Test
551     @Alerts({"1", ANCHOR})
552     public void submitGet_urlHash_hash() throws Exception {
553         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetHash", Integer.parseInt(getExpectedAlerts()[0]),
554                 PATHNAME, getExpectedAlerts()[1]);
555     }
556 
557     /**
558      * @exception Exception If the test fails
559      */
560     @Test
561     @Alerts(ANCHOR)
562     public void submitGetV_urlHash_hash() throws Exception {
563         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetHashV", 1, PATHNAME, getExpectedAlerts()[0]);
564     }
565 
566     /**
567      * @exception Exception If the test fails
568      */
569     @Test
570     @Alerts({"1", ANCHOR2 })
571     public void submitGet_urlHash_differentHash() throws Exception {
572         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentHash", Integer.parseInt(getExpectedAlerts()[0]),
573                 PATHNAME, getExpectedAlerts()[1]);
574     }
575 
576     /**
577      * @exception Exception If the test fails
578      */
579     @Test
580     @Alerts(ANCHOR2)
581     public void submitGetV_urlHash_differentHash() throws Exception {
582         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentHashV", 1,
583                 PATHNAME, getExpectedAlerts()[0]);
584     }
585 
586     /**
587      * @exception Exception If the test fails
588      */
589     @Test
590     public void submitGet_urlHash_url() throws Exception {
591         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetUrl", 1, PATHNAME, "");
592     }
593 
594     /**
595      * @exception Exception If the test fails
596      */
597     @Test
598     public void submitGetV_urlHash_url() throws Exception {
599         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetUrlV", 1, PATHNAME, "");
600     }
601 
602     /**
603      * @exception Exception If the test fails
604      */
605     @Test
606     @Alerts({"1", ANCHOR})
607     public void submitGet_urlHash_urlHash() throws Exception {
608         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetUrlHash", Integer.parseInt(getExpectedAlerts()[0]),
609                 PATHNAME, getExpectedAlerts()[1]);
610     }
611 
612     /**
613      * @exception Exception If the test fails
614      */
615     @Test
616     @Alerts(ANCHOR)
617     public void submitGetV_urlHash_urlHash() throws Exception {
618         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetUrlHashV", 1,
619                 PATHNAME, getExpectedAlerts()[0]);
620     }
621 
622     /**
623      * @exception Exception If the test fails
624      */
625     @Test
626     public void submitGet_urlHash_differentUrl() throws Exception {
627         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentUrl", 1, PATHNAME2, "");
628     }
629 
630     /**
631      * @exception Exception If the test fails
632      */
633     @Test
634     public void submitGetV_urlHash_differentUrl() throws Exception {
635         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentUrlV", 1, PATHNAME2, "");
636     }
637 
638     /**
639      * @exception Exception If the test fails
640      */
641     @Test
642     public void submitGet_urlHash_differentUrlEmptyHash() throws Exception {
643         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentUrlEmptyHash", 1, PATHNAME2, "");
644     }
645 
646     /**
647      * @exception Exception If the test fails
648      */
649     @Test
650     @Alerts(ANCHOR)
651     public void submitGet_urlHash_differentUrlHash() throws Exception {
652         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentUrlHash", 1, PATHNAME2, getExpectedAlerts()[0]);
653     }
654 
655     /**
656      * @exception Exception If the test fails
657      */
658     @Test
659     public void submitGetV_urlHash_differentUrlEmptyHash() throws Exception {
660         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentUrlEmptyHashV", 1, PATHNAME2, "");
661     }
662 
663     /**
664      * @exception Exception If the test fails
665      */
666     @Test
667     @Alerts(ANCHOR)
668     public void submitGetV_urlHash_differentUrlHash() throws Exception {
669         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentUrlHashV", 1, PATHNAME2, getExpectedAlerts()[0]);
670     }
671 
672     /**
673      * @exception Exception If the test fails
674      */
675     @Test
676     @Alerts(ANCHOR2)
677     public void submitGet_urlHash_differentUrlDifferentHash() throws Exception {
678         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentUrlDifferentHash", 1,
679                 PATHNAME2, getExpectedAlerts()[0]);
680     }
681 
682     /**
683      * @exception Exception If the test fails
684      */
685     @Test
686     @Alerts(ANCHOR2)
687     public void submitGetV_urlHash_differentUrlDifferentHash() throws Exception {
688         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitGetDifferentUrlDifferentHashV", 1,
689                 PATHNAME2, getExpectedAlerts()[0]);
690     }
691 
692     /**
693      * @exception Exception If the test fails
694      */
695     @Test
696     public void submitPost_url_emptyUrl() throws Exception {
697         openUrlAndClickById(RELOAD_URL, "submitPostEmpty", 1, PATHNAME, "");
698     }
699 
700     /**
701      * @exception Exception If the test fails
702      */
703     @Test
704     public void submitPostV_url_emptyUrl() throws Exception {
705         openUrlAndClickById(RELOAD_URL, "submitPostEmptyV", 1, PATHNAME, "");
706     }
707 
708     /**
709      * @exception Exception If the test fails
710      */
711     @Test
712     @Alerts("")
713     public void submitPost_url_emptyHash() throws Exception {
714         openUrlAndClickById(RELOAD_URL, "submitPostEmptyHash", 1, PATHNAME, getExpectedAlerts()[0]);
715     }
716 
717     /**
718      * @exception Exception If the test fails
719      */
720     @Test
721     @Alerts("")
722     public void submitPostV_url_emptyHash() throws Exception {
723         openUrlAndClickById(RELOAD_URL, "submitPostEmptyHashV", 1, PATHNAME, getExpectedAlerts()[0]);
724     }
725 
726     /**
727      * @exception Exception If the test fails
728      */
729     @Test
730     public void submitPost_url_hash() throws Exception {
731         openUrlAndClickById(RELOAD_URL, "submitPostHash", 1, PATHNAME, ANCHOR);
732     }
733 
734     /**
735      * @exception Exception If the test fails
736      */
737     @Test
738     public void submitPostV_url_hash() throws Exception {
739         openUrlAndClickById(RELOAD_URL, "submitPostHashV", 1, PATHNAME, ANCHOR);
740     }
741 
742     /**
743      * @exception Exception If the test fails
744      */
745     @Test
746     public void submitPost_url_differentHash() throws Exception {
747         openUrlAndClickById(RELOAD_URL, "submitPostDifferentHash", 1, PATHNAME, ANCHOR2);
748     }
749 
750     /**
751      * @exception Exception If the test fails
752      */
753     @Test
754     public void submitPostV_url_differentHash() throws Exception {
755         openUrlAndClickById(RELOAD_URL, "submitPostDifferentHashV", 1, PATHNAME, ANCHOR2);
756     }
757 
758     /**
759      * @exception Exception If the test fails
760      */
761     @Test
762     public void submitPost_url_url() throws Exception {
763         openUrlAndClickById(RELOAD_URL, "submitPostUrl", 1, PATHNAME, "");
764     }
765 
766     /**
767      * @exception Exception If the test fails
768      */
769     @Test
770     public void submitPostV_url_url() throws Exception {
771         openUrlAndClickById(RELOAD_URL, "submitPostUrlV", 1, PATHNAME, "");
772     }
773 
774     /**
775      * @exception Exception If the test fails
776      */
777     @Test
778     public void submitPost_url_urlHash() throws Exception {
779         openUrlAndClickById(RELOAD_URL, "submitPostUrlHash", 1, PATHNAME, ANCHOR);
780     }
781 
782     /**
783      * @exception Exception If the test fails
784      */
785     @Test
786     public void submitPostV_url_urlHash() throws Exception {
787         openUrlAndClickById(RELOAD_URL, "submitPostUrlHashV", 1, PATHNAME, ANCHOR);
788     }
789 
790     /**
791      * @exception Exception If the test fails
792      */
793     @Test
794     public void submitPost_url_differentUrl() throws Exception {
795         openUrlAndClickById(RELOAD_URL, "submitPostDifferentUrl", 1, PATHNAME2, "");
796     }
797 
798     /**
799      * @exception Exception If the test fails
800      */
801     @Test
802     public void submitPostV_url_differentUrl() throws Exception {
803         openUrlAndClickById(RELOAD_URL, "submitPostDifferentUrlV", 1, PATHNAME2, "");
804     }
805 
806     /**
807      * @exception Exception If the test fails
808      */
809     @Test
810     @Alerts("")
811     public void submitPost_url_differentUrlEmptyHash() throws Exception {
812         openUrlAndClickById(RELOAD_URL, "submitPostDifferentUrlEmptyHash",
813                 1, PATHNAME2, getExpectedAlerts()[0]);
814     }
815 
816     /**
817      * @exception Exception If the test fails
818      */
819     @Test
820     public void submitPost_url_differentUrlHash() throws Exception {
821         openUrlAndClickById(RELOAD_URL, "submitPostDifferentUrlHash", 1, PATHNAME2, ANCHOR);
822     }
823 
824     /**
825      * @exception Exception If the test fails
826      */
827     @Test
828     @Alerts("")
829     public void submitPostV_url_differentUrlEmptyHash() throws Exception {
830         openUrlAndClickById(RELOAD_URL, "submitPostDifferentUrlEmptyHashV",
831                 1, PATHNAME2, getExpectedAlerts()[0]);
832     }
833 
834     /**
835      * @exception Exception If the test fails
836      */
837     @Test
838     public void submitPostV_url_differentUrlHash() throws Exception {
839         openUrlAndClickById(RELOAD_URL, "submitPostDifferentUrlHashV", 1, PATHNAME2, ANCHOR);
840     }
841 
842     /**
843      * @exception Exception If the test fails
844      */
845     @Test
846     public void submitPost_url_differentUrlDifferentHash() throws Exception {
847         openUrlAndClickById(RELOAD_URL, "submitPostDifferentUrlDifferentHash", 1, PATHNAME2, ANCHOR2);
848     }
849 
850     /**
851      * @exception Exception If the test fails
852      */
853     @Test
854     public void submitPostV_url_differentUrlDifferentHash() throws Exception {
855         openUrlAndClickById(RELOAD_URL, "submitPostDifferentUrlDifferentHashV", 1, PATHNAME2, ANCHOR2);
856     }
857 
858     /**
859      * @exception Exception If the test fails
860      */
861     @Test
862     @Alerts(ANCHOR)
863     public void submitPost_urlHash_emptyUrl() throws Exception {
864         openUrlAndClickById(URL_FIRST + "reload.html#anchor",
865                 "submitPostEmpty", 1, PATHNAME, getExpectedAlerts()[0]);
866     }
867 
868     /**
869      * @exception Exception If the test fails
870      */
871     @Test
872     @Alerts(ANCHOR)
873     public void submitPostV_urlHash_emptyUrl() throws Exception {
874         openUrlAndClickById(URL_FIRST + "reload.html#anchor",
875                 "submitPostEmptyV", 1, PATHNAME, getExpectedAlerts()[0]);
876     }
877 
878     /**
879      * @exception Exception If the test fails
880      */
881     @Test
882     public void submitPost_urlHash_hash() throws Exception {
883         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostHash", 1, PATHNAME, ANCHOR);
884     }
885 
886     /**
887      * @exception Exception If the test fails
888      */
889     @Test
890     public void submitPostV_urlHash_hash() throws Exception {
891         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostHashV", 1, PATHNAME, ANCHOR);
892     }
893 
894     /**
895      * @exception Exception If the test fails
896      */
897     @Test
898     public void submitPost_urlHash_differentHash() throws Exception {
899         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentHash", 1, PATHNAME, ANCHOR2);
900     }
901 
902     /**
903      * @exception Exception If the test fails
904      */
905     @Test
906     public void submitPostV_urlHash_differentHash() throws Exception {
907         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentHashV", 1, PATHNAME, ANCHOR2);
908     }
909 
910     /**
911      * @exception Exception If the test fails
912      */
913     @Test
914     public void submitPost_urlHash_url() throws Exception {
915         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostUrl", 1, PATHNAME, "");
916     }
917 
918     /**
919      * @exception Exception If the test fails
920      */
921     @Test
922     public void submitPostV_urlHash_url() throws Exception {
923         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostUrlV", 1, PATHNAME, "");
924     }
925 
926     /**
927      * @exception Exception If the test fails
928      */
929     @Test
930     public void submitPost_urlHash_urlHash() throws Exception {
931         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostUrlHash", 1, PATHNAME, ANCHOR);
932     }
933 
934     /**
935      * @exception Exception If the test fails
936      */
937     @Test
938     public void submitPostV_urlHash_urlHash() throws Exception {
939         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostUrlHashV", 1, PATHNAME, ANCHOR);
940     }
941 
942     /**
943      * @exception Exception If the test fails
944      */
945     @Test
946     public void submitPost_urlHash_differentUrl() throws Exception {
947         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentUrl", 1, PATHNAME2, "");
948     }
949 
950     /**
951      * @exception Exception If the test fails
952      */
953     @Test
954     public void submitPostV_urlHash_differentUrl() throws Exception {
955         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentUrlV", 1, PATHNAME2, "");
956     }
957 
958     /**
959      * @exception Exception If the test fails
960      */
961     @Test
962     @Alerts("")
963     public void submitPost_urlHash_differentUrlEmptyHash() throws Exception {
964         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentUrlEmptyHash",
965                 1, PATHNAME2, getExpectedAlerts()[0]);
966     }
967 
968     /**
969      * @exception Exception If the test fails
970      */
971     @Test
972     public void submitPost_urlHash_differentUrlHash() throws Exception {
973         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentUrlHash", 1, PATHNAME2, ANCHOR);
974     }
975 
976     /**
977      * @exception Exception If the test fails
978      */
979     @Test
980     @Alerts("")
981     public void submitPostV_urlHash_differentUrlEmptyHash() throws Exception {
982         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentUrlEmptyHashV",
983                 1, PATHNAME2, getExpectedAlerts()[0]);
984     }
985 
986     /**
987      * @exception Exception If the test fails
988      */
989     @Test
990     public void submitPostV_urlHash_differentUrlHash() throws Exception {
991         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentUrlHashV", 1, PATHNAME2, ANCHOR);
992     }
993 
994     /**
995      * @exception Exception If the test fails
996      */
997     @Test
998     public void submitPost_urlHash_differentUrlDifferentHash() throws Exception {
999         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentUrlDifferentHash", 1, PATHNAME2, ANCHOR2);
1000     }
1001 
1002     /**
1003      * @exception Exception If the test fails
1004      */
1005     @Test
1006     public void submitPostV_urlHash_differentUrlDifferentHash() throws Exception {
1007         openUrlAndClickById(RELOAD_URL_ANCHOR, "submitPostDifferentUrlDifferentHashV", 1, PATHNAME2, ANCHOR2);
1008     }
1009 
1010     /**
1011      * @exception Exception If the test fails
1012      */
1013     @Test
1014     public void jsSubmitGet_url_emptyUrl() throws Exception {
1015         openUrlAndClickById(RELOAD_URL, "jsSubmitGetEmpty", 1, PATHNAME, "");
1016     }
1017 
1018     /**
1019      * @exception Exception If the test fails
1020      */
1021     @Test
1022     public void jsSubmitGetV_url_emptyUrl() throws Exception {
1023         openUrlAndClickById(RELOAD_URL, "jsSubmitGetEmptyV", 1, PATHNAME, "");
1024     }
1025 
1026     /**
1027      * @exception Exception If the test fails
1028      */
1029     @Test
1030     @Alerts("1")
1031     public void jsSubmitGet_url_emptyHash() throws Exception {
1032         openUrlAndClickById(RELOAD_URL, "jsSubmitGetEmptyHash", Integer.parseInt(getExpectedAlerts()[0]), PATHNAME, "");
1033     }
1034 
1035     /**
1036      * @exception Exception If the test fails
1037      */
1038     @Test
1039     public void jsSubmitGetV_url_emptyHash() throws Exception {
1040         openUrlAndClickById(RELOAD_URL, "jsSubmitGetEmptyHashV", 1, PATHNAME, "");
1041     }
1042 
1043     /**
1044      * @exception Exception If the test fails
1045      */
1046     @Test
1047     @Alerts({"1", ANCHOR})
1048     public void jsSubmitGet_url_hash() throws Exception {
1049         openUrlAndClickById(RELOAD_URL, "jsSubmitGetHash", Integer.parseInt(getExpectedAlerts()[0]),
1050                     PATHNAME, getExpectedAlerts()[1]);
1051     }
1052 
1053     /**
1054      * @exception Exception If the test fails
1055      */
1056     @Test
1057     @Alerts(ANCHOR)
1058     public void jsSubmitGetV_url_hash() throws Exception {
1059         openUrlAndClickById(RELOAD_URL, "jsSubmitGetHashV", 1, PATHNAME, getExpectedAlerts()[0]);
1060     }
1061 
1062     /**
1063      * @exception Exception If the test fails
1064      */
1065     @Test
1066     @Alerts({"1", ANCHOR2 })
1067     public void jsSubmitGet_url_differentHash() throws Exception {
1068         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentHash", Integer.parseInt(getExpectedAlerts()[0]),
1069                 PATHNAME, getExpectedAlerts()[1]);
1070     }
1071 
1072     /**
1073      * @exception Exception If the test fails
1074      */
1075     @Test
1076     @Alerts(ANCHOR2)
1077     public void jsSubmitGetV_url_differentHash() throws Exception {
1078         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentHashV", 1, PATHNAME, getExpectedAlerts()[0]);
1079     }
1080 
1081     /**
1082      * @exception Exception If the test fails
1083      */
1084     @Test
1085     public void jsSubmitGet_url_url() throws Exception {
1086         openUrlAndClickById(RELOAD_URL, "jsSubmitGetUrl", 1, PATHNAME, "");
1087     }
1088 
1089     /**
1090      * @exception Exception If the test fails
1091      */
1092     @Test
1093     public void jsSubmitGetV_url_url() throws Exception {
1094         openUrlAndClickById(RELOAD_URL, "jsSubmitGetUrlV", 1, PATHNAME, "");
1095     }
1096 
1097     /**
1098      * @exception Exception If the test fails
1099      */
1100     @Test
1101     @Alerts({"1", ANCHOR})
1102     public void jsSubmitGet_url_urlHash() throws Exception {
1103         openUrlAndClickById(RELOAD_URL, "jsSubmitGetUrlHash", Integer.parseInt(getExpectedAlerts()[0]),
1104                 PATHNAME, getExpectedAlerts()[1]);
1105     }
1106 
1107     /**
1108      * @exception Exception If the test fails
1109      */
1110     @Test
1111     @Alerts(ANCHOR)
1112     public void jsSubmitGetV_url_urlHash() throws Exception {
1113         openUrlAndClickById(RELOAD_URL, "jsSubmitGetUrlHashV", 1, PATHNAME, getExpectedAlerts()[0]);
1114     }
1115 
1116     /**
1117      * @exception Exception If the test fails
1118      */
1119     @Test
1120     public void jsSubmitGet_url_differentUrl() throws Exception {
1121         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentUrl", 1, PATHNAME2, "");
1122     }
1123 
1124     /**
1125      * @exception Exception If the test fails
1126      */
1127     @Test
1128     public void jsSubmitGetV_url_differentUrl() throws Exception {
1129         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentUrlV", 1, PATHNAME2, "");
1130     }
1131 
1132     /**
1133      * @exception Exception If the test fails
1134      */
1135     @Test
1136     public void jsSubmitGet_url_differentUrlEmptyHash() throws Exception {
1137         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentUrlEmptyHash", 1, PATHNAME2, "");
1138     }
1139 
1140     /**
1141      * @exception Exception If the test fails
1142      */
1143     @Test
1144     @Alerts(ANCHOR)
1145     public void jsSubmitGet_url_differentUrlHash() throws Exception {
1146         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentUrlHash", 1, PATHNAME2, getExpectedAlerts()[0]);
1147     }
1148 
1149     /**
1150      * @exception Exception If the test fails
1151      */
1152     @Test
1153     public void jsSubmitGetV_url_differentUrlEmptyHash() throws Exception {
1154         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentUrlEmptyHashV", 1, PATHNAME2, "");
1155     }
1156 
1157     /**
1158      * @exception Exception If the test fails
1159      */
1160     @Test
1161     @Alerts(ANCHOR)
1162     public void jsSubmitGetV_url_differentUrlHash() throws Exception {
1163         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentUrlHashV", 1, PATHNAME2, getExpectedAlerts()[0]);
1164     }
1165 
1166     /**
1167      * @exception Exception If the test fails
1168      */
1169     @Test
1170     @Alerts(ANCHOR2)
1171     public void jsSubmitGet_url_differentUrlDifferentHash() throws Exception {
1172         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentUrlDifferentHash", 1, PATHNAME2, getExpectedAlerts()[0]);
1173     }
1174 
1175     /**
1176      * @exception Exception If the test fails
1177      */
1178     @Test
1179     @Alerts(ANCHOR2)
1180     public void jsSubmitGetV_url_differentUrlDifferentHash() throws Exception {
1181         openUrlAndClickById(RELOAD_URL, "jsSubmitGetDifferentUrlDifferentHashV", 1, PATHNAME2, getExpectedAlerts()[0]);
1182     }
1183 
1184     /**
1185      * @exception Exception If the test fails
1186      */
1187     @Test
1188     @Alerts({"1", ANCHOR})
1189     public void jsSubmitGet_urlHash_emptyUrl() throws Exception {
1190         openUrlAndClickById(URL_FIRST + "reload.html#anchor",
1191                "jsSubmitGetEmpty", Integer.parseInt(getExpectedAlerts()[0]), PATHNAME, getExpectedAlerts()[1]);
1192     }
1193 
1194     /**
1195      * @exception Exception If the test fails
1196      */
1197     @Test
1198     @Alerts(ANCHOR)
1199     public void jsSubmitGetV_urlHash_emptyUrl() throws Exception {
1200         openUrlAndClickById(URL_FIRST + "reload.html#anchor",
1201                "jsSubmitGetEmptyV", 1, PATHNAME, getExpectedAlerts()[0]);
1202     }
1203 
1204     /**
1205      * @exception Exception If the test fails
1206      */
1207     @Test
1208     @Alerts({"1", ANCHOR})
1209     public void jsSubmitGet_urlHash_hash() throws Exception {
1210         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetHash", Integer.parseInt(getExpectedAlerts()[0]),
1211                 PATHNAME, getExpectedAlerts()[1]);
1212     }
1213 
1214     /**
1215      * @exception Exception If the test fails
1216      */
1217     @Test
1218     @Alerts(ANCHOR)
1219     public void jsSubmitGetV_urlHash_hash() throws Exception {
1220         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetHashV", 1, PATHNAME, getExpectedAlerts()[0]);
1221     }
1222 
1223     /**
1224      * @exception Exception If the test fails
1225      */
1226     @Test
1227     @Alerts({"1", ANCHOR2 })
1228     public void jsSubmitGet_urlHash_differentHash() throws Exception {
1229         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentHash",
1230                 Integer.parseInt(getExpectedAlerts()[0]), PATHNAME, getExpectedAlerts()[1]);
1231     }
1232 
1233     /**
1234      * @exception Exception If the test fails
1235      */
1236     @Test
1237     @Alerts(ANCHOR2)
1238     public void jsSubmitGetV_urlHash_differentHash() throws Exception {
1239         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentHashV",
1240                 1, PATHNAME, getExpectedAlerts()[0]);
1241     }
1242 
1243     /**
1244      * @exception Exception If the test fails
1245      */
1246     @Test
1247     public void jsSubmitGet_urlHash_url() throws Exception {
1248         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetUrl", 1, PATHNAME, "");
1249     }
1250 
1251     /**
1252      * @exception Exception If the test fails
1253      */
1254     @Test
1255     public void jsSubmitGetV_urlHash_url() throws Exception {
1256         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetUrlV", 1, PATHNAME, "");
1257     }
1258 
1259     /**
1260      * @exception Exception If the test fails
1261      */
1262     @Test
1263     @Alerts({"1", ANCHOR})
1264     public void jsSubmitGet_urlHash_urlHash() throws Exception {
1265         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetUrlHash", Integer.parseInt(getExpectedAlerts()[0]),
1266                 PATHNAME, getExpectedAlerts()[1]);
1267     }
1268 
1269     /**
1270      * @exception Exception If the test fails
1271      */
1272     @Test
1273     @Alerts(ANCHOR)
1274     public void jsSubmitGetV_urlHash_urlHash() throws Exception {
1275         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetUrlHashV", 1, PATHNAME, getExpectedAlerts()[0]);
1276     }
1277 
1278     /**
1279      * @exception Exception If the test fails
1280      */
1281     @Test
1282     public void jsSubmitGet_urlHash_differentUrl() throws Exception {
1283         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentUrl", 1, PATHNAME2, "");
1284     }
1285 
1286     /**
1287      * @exception Exception If the test fails
1288      */
1289     @Test
1290     public void jsSubmitGetV_urlHash_differentUrl() throws Exception {
1291         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentUrlV", 1, PATHNAME2, "");
1292     }
1293 
1294     /**
1295      * @exception Exception If the test fails
1296      */
1297     @Test
1298     public void jsSubmitGet_urlHash_differentUrlEmptyHash() throws Exception {
1299         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentUrlEmptyHash", 1, PATHNAME2, "");
1300     }
1301 
1302     /**
1303      * @exception Exception If the test fails
1304      */
1305     @Test
1306     @Alerts(ANCHOR)
1307     public void jsSubmitGet_urlHash_differentUrlHash() throws Exception {
1308         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentUrlHash", 1, PATHNAME2, getExpectedAlerts()[0]);
1309     }
1310 
1311     /**
1312      * @exception Exception If the test fails
1313      */
1314     @Test
1315     public void jsSubmitGetV_urlHash_differentUrlEmptyHash() throws Exception {
1316         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentUrlEmptyHashV",
1317                 1, PATHNAME2, "");
1318     }
1319 
1320     /**
1321      * @exception Exception If the test fails
1322      */
1323     @Test
1324     @Alerts(ANCHOR)
1325     public void jsSubmitGetV_urlHash_differentUrlHash() throws Exception {
1326         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentUrlHashV", 1, PATHNAME2, getExpectedAlerts()[0]);
1327     }
1328 
1329     /**
1330      * @exception Exception If the test fails
1331      */
1332     @Test
1333     @Alerts(ANCHOR2)
1334     public void jsSubmitGet_urlHash_differentUrlDifferentHash() throws Exception {
1335         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentUrlDifferentHash",
1336                 1, PATHNAME2, getExpectedAlerts()[0]);
1337     }
1338 
1339     /**
1340      * @exception Exception If the test fails
1341      */
1342     @Test
1343     @Alerts(ANCHOR2)
1344     public void jsSubmitGetV_urlHash_differentUrlDifferentHash() throws Exception {
1345         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitGetDifferentUrlDifferentHashV",
1346                 1, PATHNAME2, getExpectedAlerts()[0]);
1347     }
1348 
1349     /**
1350      * @exception Exception If the test fails
1351      */
1352     @Test
1353     public void jsSubmitPost_url_emptyUrl() throws Exception {
1354         openUrlAndClickById(RELOAD_URL, "jsSubmitPostEmpty", 1, PATHNAME, "");
1355     }
1356 
1357     /**
1358      * @exception Exception If the test fails
1359      */
1360     @Test
1361     public void jsSubmitPostV_url_emptyUrl() throws Exception {
1362         openUrlAndClickById(RELOAD_URL, "jsSubmitPostEmptyV", 1, PATHNAME, "");
1363     }
1364 
1365     /**
1366      * @exception Exception If the test fails
1367      */
1368     @Test
1369     @Alerts("")
1370     public void jsSubmitPost_url_EmptyHash() throws Exception {
1371         openUrlAndClickById(RELOAD_URL, "jsSubmitPostEmptyHash", 1, PATHNAME, getExpectedAlerts()[0]);
1372     }
1373 
1374     /**
1375      * @exception Exception If the test fails
1376      */
1377     @Test
1378     @Alerts("")
1379     public void jsSubmitPostV_url_EmptyHash() throws Exception {
1380         openUrlAndClickById(RELOAD_URL, "jsSubmitPostEmptyHashV", 1, PATHNAME, getExpectedAlerts()[0]);
1381     }
1382 
1383     /**
1384      * @exception Exception If the test fails
1385      */
1386     @Test
1387     public void jsSubmitPost_url_hash() throws Exception {
1388         openUrlAndClickById(RELOAD_URL, "jsSubmitPostHash", 1, PATHNAME, ANCHOR);
1389     }
1390 
1391     /**
1392      * @exception Exception If the test fails
1393      */
1394     @Test
1395     public void jsSubmitPostV_url_hash() throws Exception {
1396         openUrlAndClickById(RELOAD_URL, "jsSubmitPostHashV", 1, PATHNAME, ANCHOR);
1397     }
1398 
1399     /**
1400      * @exception Exception If the test fails
1401      */
1402     @Test
1403     public void jsSubmitPost_url_differentHash() throws Exception {
1404         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentHash", 1, PATHNAME, ANCHOR2);
1405     }
1406 
1407     /**
1408      * @exception Exception If the test fails
1409      */
1410     @Test
1411     public void jsSubmitPostV_url_differentHash() throws Exception {
1412         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentHashV", 1, PATHNAME, ANCHOR2);
1413     }
1414 
1415     /**
1416      * @exception Exception If the test fails
1417      */
1418     @Test
1419     public void jsSubmitPost_url_url() throws Exception {
1420         openUrlAndClickById(RELOAD_URL, "jsSubmitPostUrl", 1, PATHNAME, "");
1421     }
1422 
1423     /**
1424      * @exception Exception If the test fails
1425      */
1426     @Test
1427     public void jsSubmitPostV_url_url() throws Exception {
1428         openUrlAndClickById(RELOAD_URL, "jsSubmitPostUrlV", 1, PATHNAME, "");
1429     }
1430 
1431     /**
1432      * @exception Exception If the test fails
1433      */
1434     @Test
1435     public void jsSubmitPost_url_urlHash() throws Exception {
1436         openUrlAndClickById(RELOAD_URL, "jsSubmitPostUrlHash", 1, PATHNAME, ANCHOR);
1437     }
1438 
1439     /**
1440      * @exception Exception If the test fails
1441      */
1442     @Test
1443     public void jsSubmitPostV_url_urlHash() throws Exception {
1444         openUrlAndClickById(RELOAD_URL, "jsSubmitPostUrlHashV", 1, PATHNAME, ANCHOR);
1445     }
1446 
1447     /**
1448      * @exception Exception If the test fails
1449      */
1450     @Test
1451     public void jsSubmitPost_url_differentUrl() throws Exception {
1452         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentUrl", 1, PATHNAME2, "");
1453     }
1454 
1455     /**
1456      * @exception Exception If the test fails
1457      */
1458     @Test
1459     public void jsSubmitPostV_url_differentUrl() throws Exception {
1460         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentUrlV", 1, PATHNAME2, "");
1461     }
1462 
1463     /**
1464      * @exception Exception If the test fails
1465      */
1466     @Test
1467     @Alerts("")
1468     public void jsSubmitPost_url_differentUrlEmptyHash() throws Exception {
1469         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentUrlEmptyHash",
1470                 1, PATHNAME2, getExpectedAlerts()[0]);
1471     }
1472 
1473     /**
1474      * @exception Exception If the test fails
1475      */
1476     @Test
1477     public void jsSubmitPost_url_differentUrlHash() throws Exception {
1478         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentUrlHash", 1, PATHNAME2, ANCHOR);
1479     }
1480 
1481     /**
1482      * @exception Exception If the test fails
1483      */
1484     @Test
1485     @Alerts("")
1486     public void jsSubmitPostV_url_differentUrlEmptyHash() throws Exception {
1487         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentUrlEmptyHashV",
1488                 1, PATHNAME2, getExpectedAlerts()[0]);
1489     }
1490 
1491     /**
1492      * @exception Exception If the test fails
1493      */
1494     @Test
1495     public void jsSubmitPostV_url_differentUrlHash() throws Exception {
1496         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentUrlHashV", 1, PATHNAME2, ANCHOR);
1497     }
1498 
1499     /**
1500      * @exception Exception If the test fails
1501      */
1502     @Test
1503     public void jsSubmitPost_url_differentUrlDifferentHash() throws Exception {
1504         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentUrlDifferentHash", 1, PATHNAME2, ANCHOR2);
1505     }
1506 
1507     /**
1508      * @exception Exception If the test fails
1509      */
1510     @Test
1511     public void jsSubmitPostV_url_differentUrlDifferentHash() throws Exception {
1512         openUrlAndClickById(RELOAD_URL, "jsSubmitPostDifferentUrlDifferentHashV", 1, PATHNAME2, ANCHOR2);
1513     }
1514 
1515     /**
1516      * @exception Exception If the test fails
1517      */
1518     @Test
1519     @Alerts(ANCHOR)
1520     public void jsSubmitPost_urlHash_emptyUrl() throws Exception {
1521         openUrlAndClickById(URL_FIRST + "reload.html#anchor",
1522                 "jsSubmitPostEmpty", 1, PATHNAME, getExpectedAlerts()[0]);
1523     }
1524 
1525     /**
1526      * @exception Exception If the test fails
1527      */
1528     @Test
1529     @Alerts(ANCHOR)
1530     public void jsSubmitPostV_urlHash_emptyUrl() throws Exception {
1531         openUrlAndClickById(URL_FIRST + "reload.html#anchor",
1532                 "jsSubmitPostEmptyV", 1, PATHNAME, getExpectedAlerts()[0]);
1533     }
1534 
1535     /**
1536      * @exception Exception If the test fails
1537      */
1538     @Test
1539     public void jsSubmitPost_urlHash_hash() throws Exception {
1540         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostHash", 1, PATHNAME, ANCHOR);
1541     }
1542 
1543     /**
1544      * @exception Exception If the test fails
1545      */
1546     @Test
1547     public void jsSubmitPostV_urlHash_hash() throws Exception {
1548         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostHashV", 1, PATHNAME, ANCHOR);
1549     }
1550 
1551     /**
1552      * @exception Exception If the test fails
1553      */
1554     @Test
1555     public void jsSubmitPost_urlHash_differentHash() throws Exception {
1556         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentHash", 1, PATHNAME, ANCHOR2);
1557     }
1558 
1559     /**
1560      * @exception Exception If the test fails
1561      */
1562     @Test
1563     public void jsSubmitPostV_urlHash_differentHash() throws Exception {
1564         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentHashV", 1, PATHNAME, ANCHOR2);
1565     }
1566 
1567     /**
1568      * @exception Exception If the test fails
1569      */
1570     @Test
1571     public void jsSubmitPost_urlHash_url() throws Exception {
1572         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostUrl", 1, PATHNAME, "");
1573     }
1574 
1575     /**
1576      * @exception Exception If the test fails
1577      */
1578     @Test
1579     public void jsSubmitPostV_urlHash_url() throws Exception {
1580         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostUrlV", 1, PATHNAME, "");
1581     }
1582 
1583     /**
1584      * @exception Exception If the test fails
1585      */
1586     @Test
1587     public void jsSubmitPost_urlHash_urlHash() throws Exception {
1588         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostUrlHash", 1, PATHNAME, ANCHOR);
1589     }
1590 
1591     /**
1592      * @exception Exception If the test fails
1593      */
1594     @Test
1595     public void jsSubmitPostV_urlHash_urlHash() throws Exception {
1596         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostUrlHashV", 1, PATHNAME, ANCHOR);
1597     }
1598 
1599     /**
1600      * @exception Exception If the test fails
1601      */
1602     @Test
1603     public void jsSubmitPost_urlHash_differentUrl() throws Exception {
1604         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentUrl", 1, PATHNAME2, "");
1605     }
1606 
1607     /**
1608      * @exception Exception If the test fails
1609      */
1610     @Test
1611     public void jsSubmitPostV_urlHash_differentUrl() throws Exception {
1612         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentUrlV", 1, PATHNAME2, "");
1613     }
1614 
1615     /**
1616      * @exception Exception If the test fails
1617      */
1618     @Test
1619     @Alerts("")
1620     public void jsSubmitPost_urlHash_differentUrlEmptyHash() throws Exception {
1621         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentUrlEmptyHash",
1622                 1, PATHNAME2, getExpectedAlerts()[0]);
1623     }
1624 
1625     /**
1626      * @exception Exception If the test fails
1627      */
1628     @Test
1629     public void jsSubmitPost_urlHash_differentUrlHash() throws Exception {
1630         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentUrlHash", 1, PATHNAME2, ANCHOR);
1631     }
1632 
1633     /**
1634      * @exception Exception If the test fails
1635      */
1636     @Test
1637     @Alerts("")
1638     public void jsSubmitPostV_urlHash_differentUrlEmptyHash() throws Exception {
1639         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentUrlEmptyHashV",
1640                 1, PATHNAME2, getExpectedAlerts()[0]);
1641     }
1642 
1643     /**
1644      * @exception Exception If the test fails
1645      */
1646     @Test
1647     public void jsSubmitPostV_urlHash_differentUrlHash() throws Exception {
1648         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentUrlHashV", 1, PATHNAME2, ANCHOR);
1649     }
1650 
1651     /**
1652      * @exception Exception If the test fails
1653      */
1654     @Test
1655     public void jsSubmitPost_urlHash_differentUrlDifferentHash() throws Exception {
1656         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentUrlDifferentHash", 1, PATHNAME2, ANCHOR2);
1657     }
1658 
1659     /**
1660      * @exception Exception If the test fails
1661      */
1662     @Test
1663     public void jsSubmitPostV_urlHash_differentUrlDifferentHash() throws Exception {
1664         openUrlAndClickById(RELOAD_URL_ANCHOR, "jsSubmitPostDifferentUrlDifferentHashV", 1, PATHNAME2, ANCHOR2);
1665     }
1666 
1667     private void openUrlAndClickById(
1668             final String url,
1669             final String id,
1670             final int counterChange,
1671             final String expectedPathname,
1672             final String expectedHash) throws Exception {
1673 
1674         final String html = testPage();
1675 
1676         getMockWebConnection().setDefaultResponse(testResponse());
1677         getMockWebConnection().setResponse(new URL(RELOAD_URL), html);
1678         getMockWebConnection().setResponse(new URL(RELOAD2_URL), html);
1679 
1680         final WebDriver driver = loadPage2(html, new URL(url));
1681         assertEquals(getMockWebConnection().getRequestCount(), 1);
1682 
1683         // click
1684         driver.findElement(By.id(id)).click();
1685         if (useRealBrowser()) {
1686             Thread.sleep(400);
1687         }
1688         assertEquals(counterChange, getMockWebConnection().getRequestCount() - 1);
1689 
1690         // check location visible to javascript
1691         driver.findElement(By.id("updateLocationInfo")).click();
1692         final String hash = driver.findElement(By.id("locationHash")).getText();
1693         final String pathname = driver.findElement(By.id("locationPathname")).getText();
1694 
1695         assertEquals(expectedPathname, pathname);
1696         assertEquals(expectedHash, hash);
1697     }
1698 
1699     private static String testPage() {
1700         return testPageHeader()
1701                 + testPageBody()
1702                 + testPageAnchorPart()
1703                 + testPageFormGetPart()
1704                 + testPageFormPostPart();
1705     }
1706 
1707     private static String testPageHeader() {
1708         return "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
1709                 + "<html>\n"
1710                 + "  <head>\n"
1711                 + "    <META HTTP-EQUIV='Pragma' CONTENT='text/html;charset=UTF-8'>\n"
1712                 + "    <META HTTP-EQUIV='Pragma' CONTENT='no-cache'>\n"
1713                 + "    <META HTTP-EQUIV='CACHE-CONTROL' CONTENT='NO-CACHE'>\n"
1714                 + "  </head>\n";
1715     }
1716 
1717     private static String testPageBody() {
1718         return "<body>\n"
1719                 + "  <div id='locationPathname'></div>\n"
1720                 + "  <div id='locationHash'></div>\n"
1721                 + "  <input type='button' id='updateLocationInfo' value='updateLocationInfo' "
1722                 + "onclick='document.getElementById(\"locationHash\").innerHTML=location.hash;"
1723                 + "document.getElementById(\"locationPathname\").innerHTML=location.pathname;'>\n";
1724     }
1725 
1726     private static String testPageAnchorPart() {
1727         return "  <a id='linkEmpty' href=''>linkEmpty</a>\n"
1728                 + "  <a id='linkEmptyHash' href='#'>linkEmptyHash</a>\n"
1729                 + "  <a id='linkHash' href='#anchor'>linkHash</a>\n"
1730                 + "  <a id='linkDifferentHash' href='#anchor2'>linkDifferentHash</a>\n"
1731                 + "  <a id='linkUrl' href='" + RELOAD_URL + "'>linkUrl</a>\n"
1732                 + "  <a id='linkUrlHash' href='" + RELOAD_URL_ANCHOR + "'>linkUrlHash</a>\n"
1733                 + "  <a id='linkDifferentUrl' href='" + URL_FIRST + "reload2.html"
1734                 + "'>linkDifferentUrl</a>\n"
1735                 + "  <a id='linkDifferentUrlEmptyHash' href='" + URL_FIRST + "reload2.html#"
1736                 + "'>linkDifferentUrlEmptyHash</a>\n"
1737                 + "  <a id='linkDifferentUrlHash' href='" + URL_FIRST + "reload2.html"
1738                 + ANCHOR + "'>linkDifferentUrlHash</a>\n"
1739                 + "  <a id='linkDifferentUrlDifferentHash' href='" + "http://localhost:" + PORT
1740                 + "/reload2.html#anchor2" + "'>linkDifferentUrlDifferentHash</a>\n";
1741     }
1742 
1743     private static String testPageFormGetPart() {
1744         return "  <form action='' method='GET'>\n"
1745                 + "    <input type='button' id='javascriptEmpty' value='javascriptEmpty'"
1746                 + " onclick='location.href=\"\"'>\n"
1747                 + "    <input type='button' id='javascriptEmptyHash' value='javascriptHash'"
1748                 + " onclick='location.href=\"#\"'>\n"
1749                 + "    <input type='button' id='javascriptHash' value='javascriptHash'"
1750                 + " onclick='location.href=\"#anchor\"'>\n"
1751                 + "    <input type='button' id='javascriptDifferentHash' value='javascriptDifferentHash'"
1752                 + " onclick='location.href=\"#anchor2\"'>\n"
1753                 + "    <input type='button' id='javascriptUrl' value='javascriptUrl'"
1754                 + " onclick='location.href=\"" + RELOAD_URL + "\"'>\n"
1755                 + "    <input type='button' id='javascriptUrlHash' value='javascriptUrlHash'"
1756                 + " onclick='location.href=\"" + RELOAD_URL_ANCHOR + "\"'>\n"
1757                 + "    <input type='button' id='javascriptDifferentUrl' value='javascriptDifferentUrl'"
1758                 + " onclick='location.href=\"" + URL_FIRST + "reload2.html" + "\"'>\n"
1759                 + "    <input type='button' id='javascriptDifferentUrlEmptyHash' "
1760                                                     + "value='javascriptDifferentUrlEmptyHash'"
1761                 + " onclick='location.href=\"" + URL_FIRST + "reload2.html#\"'>\n"
1762                 + "    <input type='button' id='javascriptDifferentUrlHash' value='javascriptDifferentUrlHash'"
1763                 + " onclick='location.href=\"" + URL_FIRST + "reload2.html" + ANCHOR + "\"'>\n"
1764                 + "    <input type='button' id='javascriptDifferentUrlDifferentHash'"
1765                 + " value='javascriptDifferentUrlDifferentHash'"
1766                 + " onclick='location.href=\"" + URL_FIRST + "reload2.html#anchor2" + "\"'>\n"
1767                 + "  </form>\n"
1768 
1769                 // get
1770                 + "  <form action='' method='GET'>\n"
1771                 + "    <input type='submit' id='submitGetEmpty' value='submitGetEmpty' >\n"
1772                 + "    <input type='BUTTON' id='jsSubmitGetEmpty' value='jsSubmitGetEmpty'  onclick='submit();'>\n"
1773                 + "  </form>\n"
1774                 + "  <form action='' method='GET'>\n"
1775                 + "    <input type='text' name='valueGetEmptyV' />\n"
1776                 + "    <input type='submit' id='submitGetEmptyV' value='submitGetEmptyV' >\n"
1777                 + "    <input type='BUTTON' id='jsSubmitGetEmptyV' value='jsSubmitGetEmptyV'  onclick='submit();'>\n"
1778                 + "  </form>\n"
1779 
1780                 + "  <form action='#' method='GET'>\n"
1781                 + "    <input type='submit' id='submitGetEmptyHash' value='submitGetEmptyHash'/>\n"
1782                 + "    <input type='button' id='jsSubmitGetEmptyHash' value='jsSubmitGetEmptyHash'"
1783                 + " onclick='submit();'>\n"
1784                 + "  </form>\n"
1785                 + "  <form action='#' method='GET'>\n"
1786                 + "    <input type='text' name='valueGetEmptyHashV' />\n"
1787                 + "    <input type='submit' id='submitGetEmptyHashV' value='submitGetEmptyHashV'/>\n"
1788                 + "    <input type='button' id='jsSubmitGetEmptyHashV' value='jsSubmitGetEmptyHashV'"
1789                 + " onclick='submit();'>\n"
1790                 + "  </form>\n"
1791 
1792                 + "  <form action='#anchor' method='GET'>\n"
1793                 + "    <input type='submit' id='submitGetHash' value='submitGetHash'/>\n"
1794                 + "    <input type='button' id='jsSubmitGetHash' value='jsSubmitGetHash' onclick='submit();'>\n"
1795                 + "  </form>\n"
1796                 + "  <form action='#anchor' method='GET'>\n"
1797                 + "    <input type='text' name='valueGetHashV' />\n"
1798                 + "    <input type='submit' id='submitGetHashV' value='submitGetHashV'/>\n"
1799                 + "    <input type='button' id='jsSubmitGetHashV' value='jsSubmitGetHashV' onclick='submit();'>\n"
1800                 + "  </form>\n"
1801 
1802                 + "  <form action='#anchor2' method='GET'>\n"
1803                 + "    <input type='submit' id='submitGetDifferentHash' value='submitGetDifferentHash'>\n"
1804                 + "    <input type='button' id='jsSubmitGetDifferentHash' value='jsSubmitGetDifferentHash'"
1805                 + " onclick='submit();'>\n"
1806                 + "  </form>\n"
1807                 + "  <form action='#anchor2' method='GET'>\n"
1808                 + "    <input type='text' name='valueGetDifferentHashV' />\n"
1809                 + "    <input type='submit' id='submitGetDifferentHashV' value='submitGetDifferentHashV'>\n"
1810                 + "    <input type='button' id='jsSubmitGetDifferentHashV' value='jsSubmitGetDifferentHashV'"
1811                 + " onclick='submit();'>\n"
1812                 + "  </form>\n"
1813 
1814                 + "  <form action='" + RELOAD_URL + "' method='GET'>\n"
1815                 + "    <input type='submit' id='submitGetUrl' value='submitGetUrl'>\n"
1816                 + "    <input type='button' id='jsSubmitGetUrl' value='jsSubmitGetUrl' onclick='submit();'>\n"
1817                 + "  </form>\n"
1818                 + "  <form action='" + RELOAD_URL + "' method='GET'>\n"
1819                 + "    <input type='text' name='valueGetUrl' />\n"
1820                 + "    <input type='submit' id='submitGetUrlV' value='submitGetUrlV'>\n"
1821                 + "    <input type='button' id='jsSubmitGetUrlV' value='jsSubmitGetUrlV' onclick='submit();'>\n"
1822                 + "  </form>\n"
1823 
1824                 + "  <form action='" + RELOAD_URL_ANCHOR + "' method='GET'>\n"
1825                 + "    <input type='submit' id='submitGetUrlHash' value='submitGetUrlHash'>\n"
1826                 + "    <input type='button' id='jsSubmitGetUrlHash' value='jsSubmitGetUrlHash' onclick='submit();'>\n"
1827                 + "  </form>\n"
1828                 + "  <form action='" + RELOAD_URL_ANCHOR + "' method='GET'>\n"
1829                 + "    <input type='text' name='valueGetUrlHashV' />\n"
1830                 + "    <input type='submit' id='submitGetUrlHashV' value='submitGetUrlHashV'>\n"
1831                 + "    <input type='button' id='jsSubmitGetUrlHashV' value='jsSubmitGetUrlHashV' onclick='submit();'>\n"
1832                 + "  </form>\n"
1833 
1834                 + "  <form action='" + URL_FIRST + "reload2.html" + "' method='GET'>\n"
1835                 + "    <input type='submit' id='submitGetDifferentUrl' value='submitGetDifferentUrl'>\n"
1836                 + "    <input type='button' id='jsSubmitGetDifferentUrl' value='jsSubmitGetDifferentUrl'"
1837                 + " onclick='submit();'>\n"
1838                 + "  </form>\n"
1839                 + "  <form action='" + URL_FIRST + "reload2.html" + "' method='GET'>\n"
1840                 + "    <input type='text' name='valueGetDifferentUrlV' />\n"
1841                 + "    <input type='submit' id='submitGetDifferentUrlV' value='submitGetDifferentUrlV'>\n"
1842                 + "    <input type='button' id='jsSubmitGetDifferentUrlV' value='jsSubmitGetDifferentUrlV'"
1843                 + " onclick='submit();'>\n"
1844                 + "  </form>\n"
1845 
1846                 + "  <form action='" + URL_FIRST + "reload2.html#' method='GET'>\n"
1847                 + "    <input type='submit' id='submitGetDifferentUrlEmptyHash' "
1848                                                 + "value='submitGetDifferentUrlEmptyHash'>\n"
1849                 + "    <input type='button' id='jsSubmitGetDifferentUrlEmptyHash' "
1850                                                 + "value='jsSubmitGetDifferentUrlEmptyHash'"
1851                 + " onclick='submit();'>\n"
1852                 + "  </form>\n"
1853                 + "  <form action='" + URL_FIRST + "reload2.html#' method='GET'>\n"
1854                 + "    <input type='text' name='valueGetDifferentUrlEmptyHashV' />\n"
1855                 + "    <input type='submit' id='submitGetDifferentUrlEmptyHashV' "
1856                                                 + "value='submitGetDifferentUrlEmptyHashV'>\n"
1857                 + "    <input type='button' id='jsSubmitGetDifferentUrlEmptyHashV' "
1858                                                 + "value='jsSubmitGetDifferentUrlEmptyHashV'"
1859                 + " onclick='submit();'>\n"
1860                 + "  </form>\n"
1861 
1862                 + "  <form action='" + URL_FIRST + "reload2.html" + ANCHOR + "' method='GET'>\n"
1863                 + "    <input type='submit' id='submitGetDifferentUrlHash' value='submitGetDifferentUrlHash'>\n"
1864                 + "    <input type='button' id='jsSubmitGetDifferentUrlHash' value='jsSubmitGetDifferentUrlHash'"
1865                 + " onclick='submit();'>\n"
1866                 + "  </form>\n"
1867                 + "  <form action='" + URL_FIRST + "reload2.html" + ANCHOR + "' method='GET'>\n"
1868                 + "    <input type='text' name='valueGetDifferentUrlHashV' />\n"
1869                 + "    <input type='submit' id='submitGetDifferentUrlHashV' value='submitGetDifferentUrlHashV'>\n"
1870                 + "    <input type='button' id='jsSubmitGetDifferentUrlHashV' value='jsSubmitGetDifferentUrlHashV'"
1871                 + " onclick='submit();'>\n"
1872                 + "  </form>\n"
1873 
1874                 + "  <form action='" + URL_FIRST + "reload2.html#anchor2" + "' method='GET'>\n"
1875                 + "    <input type='submit' id='submitGetDifferentUrlDifferentHash'"
1876                 + " value='submitGetDifferentUrlDifferentHash'>\n"
1877                 + "    <input type='button' id='jsSubmitGetDifferentUrlDifferentHash'"
1878                 + " value='jsSubmitGetDifferentUrlDifferentHash' onclick='submit();'>\n"
1879                 + "  </form>\n"
1880                 + "  <form action='" + URL_FIRST + "reload2.html#anchor2" + "' method='GET'>\n"
1881                 + "    <input type='text' name='valueGetDifferentUrlDifferentHashV' />\n"
1882                 + "    <input type='submit' id='submitGetDifferentUrlDifferentHashV'"
1883                 + " value='submitGetDifferentUrlDifferentHashV'>\n"
1884                 + "    <input type='button' id='jsSubmitGetDifferentUrlDifferentHashV'"
1885                 + " value='jsSubmitGetDifferentUrlDifferentHashV' onclick='submit();'>\n"
1886                 + "  </form>\n";
1887     }
1888 
1889     private static String testPageFormPostPart() {
1890         return "  <form action='' method='POST'>\n"
1891                 + "    <input type='submit' id='submitPostEmpty' value='submitPostEmpty'>\n"
1892                 + "    <input type='BUTTON' id='jsSubmitPostEmpty' value='jsSubmitPostEmpty'  onclick='submit();'>\n"
1893                 + "  </form>\n"
1894                 + "  <form action='' method='POST'>\n"
1895                 + "    <input type='text' name='valuePostEmptyV' />\n"
1896                 + "    <input type='submit' id='submitPostEmptyV' value='submitPostEmptyV'>\n"
1897                 + "    <input type='BUTTON' id='jsSubmitPostEmptyV' value='jsSubmitPostEmptyV'  onclick='submit();'>\n"
1898                 + "  </form>\n"
1899 
1900                 + "  <form action='#' method='POST'>\n"
1901                 + "    <input type='submit' id='submitPostEmptyHash' value='submitPostEmptyHash'>\n"
1902                 + "    <input type='button' id='jsSubmitPostEmptyHash' value='jsSubmitPostEmptyHash'"
1903                 + "onclick='submit();'>\n"
1904                 + "  </form>\n"
1905                 + "  <form action='#' method='POST'>\n"
1906                 + "    <input type='text' name='valuePostEmptyHashV' />\n"
1907                 + "    <input type='submit' id='submitPostEmptyHashV' value='submitPostEmptyHashV'>\n"
1908                 + "    <input type='button' id='jsSubmitPostEmptyHashV' value='jsSubmitPostEmptyHashV'"
1909                 + "onclick='submit();'>\n"
1910                 + "  </form>\n"
1911 
1912                 + "  <form action='#anchor' method='POST'>\n"
1913                 + "    <input type='submit' id='submitPostHash' value='submitPostHash'>\n"
1914                 + "    <input type='button' id='jsSubmitPostHash' value='jsSubmitPostHash' onclick='submit();'>\n"
1915                 + "  </form>\n"
1916                 + "  <form action='#anchor' method='POST'>\n"
1917                 + "    <input type='text' name='valuePostHashV' />\n"
1918                 + "    <input type='submit' id='submitPostHashV' value='submitPostHashV'>\n"
1919                 + "    <input type='button' id='jsSubmitPostHashV' value='jsSubmitPostHashV' onclick='submit();'>\n"
1920                 + "  </form>\n"
1921 
1922                 + "  <form action='#anchor2' method='POST'>\n"
1923                 + "    <input type='submit' id='submitPostDifferentHash' value='submitPostDifferentHash'>\n"
1924                 + "    <input type='button' id='jsSubmitPostDifferentHash' value='jsSubmitPostDifferentHash'"
1925                 + " onclick='submit();'>\n"
1926                 + "  </form>\n"
1927                 + "  <form action='#anchor2' method='POST'>\n"
1928                 + "    <input type='text' name='valuePostDifferentHashV' />\n"
1929                 + "    <input type='submit' id='submitPostDifferentHashV' value='submitPostDifferentHashV'>\n"
1930                 + "    <input type='button' id='jsSubmitPostDifferentHashV' value='jsSubmitPostDifferentHashV'"
1931                 + " onclick='submit();'>\n"
1932                 + "  </form>\n"
1933 
1934                 + "  <form action='" + RELOAD_URL + "' method='POST'>\n"
1935                 + "    <input type='submit' id='submitPostUrl' value='submitPostUrl'>\n"
1936                 + "    <input type='button' id='jsSubmitPostUrl' value='jsSubmitPostUrl' onclick='submit();'>\n"
1937                 + "  </form>\n"
1938                 + "  <form action='" + RELOAD_URL + "' method='POST'>\n"
1939                 + "    <input type='text' name='valuePostUrlV' />\n"
1940                 + "    <input type='submit' id='submitPostUrlV' value='submitPostUrlV'>\n"
1941                 + "    <input type='button' id='jsSubmitPostUrlV' value='jsSubmitPostUrlV' onclick='submit();'>\n"
1942                 + "  </form>\n"
1943 
1944                 + "  <form action='" + RELOAD_URL_ANCHOR + "' method='POST'>\n"
1945                 + "    <input type='submit' id='submitPostUrlHash' value='submitPostUrlHash'>\n"
1946                 + "    <input type='button' id='jsSubmitPostUrlHash' value='jsSubmitPostUrlHash' onclick='submit();'>\n"
1947                 + "  </form>\n"
1948                 + "  <form action='" + RELOAD_URL_ANCHOR + "' method='POST'>\n"
1949                 + "    <input type='text' name='valuePostUrlHashV' />\n"
1950                 + "    <input type='submit' id='submitPostUrlHashV' value='submitPostUrlHashV'>\n"
1951                 + "    <input type='button' id='jsSubmitPostUrlHashV' value='jsSubmitPostUrlHashV'"
1952                 + " onclick='submit();'>\n"
1953                 + "  </form>\n"
1954 
1955                 + "  <form action='" + URL_FIRST + "reload2.html" + "' method='POST'>\n"
1956                 + "    <input type='submit' id='submitPostDifferentUrl' value='submitPostDifferentUrl'>\n"
1957                 + "    <input type='button' id='jsSubmitPostDifferentUrl' value='jsSubmitPostDifferentUrl'"
1958                 + " onclick='submit();'>\n"
1959                 + "  </form>\n"
1960                 + "  <form action='" + URL_FIRST + "reload2.html" + "' method='POST'>\n"
1961                 + "    <input type='text' name='valuePostDifferentUrlV' />\n"
1962                 + "    <input type='submit' id='submitPostDifferentUrlV' value='submitPostDifferentUrlV'>\n"
1963                 + "    <input type='button' id='jsSubmitPostDifferentUrlV' value='jsSubmitPostDifferentUrlV'"
1964                 + " onclick='submit();'>\n"
1965                 + "  </form>\n"
1966 
1967                 + "  <form action='" + URL_FIRST + "reload2.html#' method='POST'>\n"
1968                 + "    <input type='submit' id='submitPostDifferentUrlEmptyHash' "
1969                                                 + "value='submitPostDifferentUrlEmptyHash'>\n"
1970                 + "    <input type='button' id='jsSubmitPostDifferentUrlEmptyHash'"
1971                 + " value='jsSubmitPostDifferentUrlEmptyHash' onclick='submit();'>\n"
1972                 + "  </form>\n"
1973                 + "  <form action='" + URL_FIRST + "reload2.html#' method='POST'>\n"
1974                 + "    <input type='text' name='valuePostDifferentUrlEmptyHashV' />\n"
1975                 + "    <input type='submit' id='submitPostDifferentUrlEmptyHashV' "
1976                                                 + "value='submitPostDifferentUrlEmptyHashV'>\n"
1977                 + "    <input type='button' id='jsSubmitPostDifferentUrlEmptyHashV'"
1978                 + " value='jsSubmitPostDifferentUrlEmptyHashV' onclick='submit();'>\n"
1979                 + "  </form>\n"
1980 
1981                 + "  <form action='" + URL_FIRST + "reload2.html" + ANCHOR + "' method='POST'>\n"
1982                 + "    <input type='submit' id='submitPostDifferentUrlHash' value='submitPostDifferentUrlHash'>\n"
1983                 + "    <input type='button' id='jsSubmitPostDifferentUrlHash'"
1984                 + " value='jsSubmitPostDifferentUrlHash' onclick='submit();'>\n"
1985                 + "  </form>\n"
1986                 + "  <form action='" + URL_FIRST + "reload2.html" + ANCHOR + "' method='POST'>\n"
1987                 + "    <input type='text' name='valuePostDifferentUrlHashV' />\n"
1988                 + "    <input type='submit' id='submitPostDifferentUrlHashV' value='submitPostDifferentUrlHashV'>\n"
1989                 + "    <input type='button' id='jsSubmitPostDifferentUrlHashV'"
1990                 + " value='jsSubmitPostDifferentUrlHashV' onclick='submit();'>\n"
1991                 + "  </form>\n"
1992 
1993                 + "  <form action='" + URL_FIRST + "reload2.html#anchor2" + "' method='POST'>\n"
1994                 + "    <input type='submit' id='submitPostDifferentUrlDifferentHash'"
1995                 + " value='submitPostDifferentUrlDifferentHash'>\n"
1996                 + "    <input type='button' id='jsSubmitPostDifferentUrlDifferentHash'"
1997                 + " value='jsSubmitPostDifferentUrlDifferentHash' onclick='submit();'>\n"
1998                 + "  </form>\n"
1999                 + "  <form action='" + URL_FIRST + "reload2.html#anchor2" + "' method='POST'>\n"
2000                 + "    <input type='text' name='valuePostDifferentUrlDifferentHashV' />\n"
2001                 + "    <input type='submit' id='submitPostDifferentUrlDifferentHashV'"
2002                 + " value='submitPostDifferentUrlDifferentHashV'>\n"
2003                 + "    <input type='button' id='jsSubmitPostDifferentUrlDifferentHashV'"
2004                 + " value='jsSubmitPostDifferentUrlDifferentHashV' onclick='submit();'>\n"
2005                 + "  </form>\n"
2006 
2007                 + "</body>\n"
2008                 + "</html>";
2009     }
2010 
2011     private static String testResponse() {
2012         return "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
2013                 + "<html>\n"
2014                 + "  <head>\n"
2015                 + "    <META HTTP-EQUIV='Pragma' CONTENT='no-cache'>\n"
2016                 + "    <META HTTP-EQUIV='CACHE-CONTROL' CONTENT='NO-CACHE'>\n"
2017                 + "  </head>\n"
2018 
2019                 + "<body>\n"
2020 
2021                 + "  <div id='locationPathname'></div>\n"
2022                 + "  <div id='locationHash'></div>\n"
2023                 + "  <input type='button' id='updateLocationInfo' value='updateLocationInfo' "
2024                 + "onclick='document.getElementById(\"locationHash\").innerHTML=location.hash;"
2025                 + "document.getElementById(\"locationPathname\").innerHTML=location.pathname;'>\n"
2026 
2027                 + "</body>\n"
2028                 + "</html>";
2029     }
2030 }