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