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.general;
16  
17  import org.htmlunit.WebDriverTestCase;
18  import org.htmlunit.junit.BrowserRunner;
19  import org.htmlunit.junit.annotation.Alerts;
20  import org.junit.Test;
21  import org.junit.runner.RunWith;
22  
23  /**
24   * Tests the result of <code>document.createElement()</code>.
25   *
26   * @author Ahmed Ashour
27   * @author Ronald Brill
28   */
29  @RunWith(BrowserRunner.class)
30  public class ElementCreationTest extends WebDriverTestCase {
31  
32      private void test(final String tagName) throws Exception {
33          final String html = DOCTYPE_HTML
34              + "<html><head><script>\n"
35              + "  function test() {\n"
36              + "    try {\n"
37              + "      alert(document.createElement('" + tagName + "'));\n"
38              + "    } catch(e) {alert('exception')}\n"
39              + "  }\n"
40              + "</script></head><body onload='test()'>\n"
41              + "</body></html>";
42  
43          loadPageWithAlerts2(html);
44      }
45  
46      /**
47       * Test {@link org.htmlunit.html.HtmlAbbreviated}.
48       *
49       * @throws Exception if an error occurs
50       */
51      @Test
52      @Alerts("[object HTMLElement]")
53      public void abbr() throws Exception {
54          test("abbr");
55      }
56  
57      /**
58       * Test {@link org.htmlunit.html.HtmlAcronym}.
59       *
60       * @throws Exception if an error occurs
61       */
62      @Test
63      @Alerts("[object HTMLElement]")
64      public void acronym() throws Exception {
65          test("acronym");
66      }
67  
68      /**
69       * Test {@link org.htmlunit.html.HtmlAddress}.
70       *
71       * @throws Exception if an error occurs
72       */
73      @Test
74      @Alerts("[object HTMLElement]")
75      public void address() throws Exception {
76          test("address");
77      }
78  
79      /**
80       * Test {@link org.htmlunit.html.HtmlAnchor}.
81       *
82       * @throws Exception if an error occurs
83       */
84      @Test
85      @Alerts("")
86      public void a() throws Exception {
87          test("a");
88      }
89  
90      /**
91       * Test {@link org.htmlunit.html.HtmlApplet}.
92       *
93       * @throws Exception if an error occurs
94       */
95      @Test
96      @Alerts("[object HTMLUnknownElement]")
97      public void applet() throws Exception {
98          test("applet");
99      }
100 
101     /**
102      * Test {@link org.htmlunit.html.HtmlArea}.
103      *
104      * @throws Exception if an error occurs
105      */
106     @Test
107     @Alerts("")
108     public void area() throws Exception {
109         test("area");
110     }
111 
112     /**
113      * Test {@link org.htmlunit.html.HtmlArticle}.
114      *
115      * @throws Exception if an error occurs
116      */
117     @Test
118     @Alerts("[object HTMLElement]")
119     public void article() throws Exception {
120         test("article");
121     }
122 
123     /**
124      * Test {@link org.htmlunit.html.HtmlAside}.
125      *
126      * @throws Exception if an error occurs
127      */
128     @Test
129     @Alerts("[object HTMLElement]")
130     public void aside() throws Exception {
131         test("aside");
132     }
133 
134     /**
135      * Test {@link org.htmlunit.html.HtmlAudio}.
136      *
137      * @throws Exception if an error occurs
138      */
139     @Test
140     @Alerts("[object HTMLAudioElement]")
141     public void audio() throws Exception {
142         test("audio");
143     }
144 
145     /**
146      * Test {@link org.htmlunit.html.HtmlBackgroundSound}.
147      *
148      * @throws Exception if an error occurs
149      */
150     @Test
151     @Alerts("[object HTMLUnknownElement]")
152     public void bgsound() throws Exception {
153         test("bgsound");
154     }
155 
156     /**
157      * Test {@link org.htmlunit.html.HtmlBase}.
158      *
159      * @throws Exception if an error occurs
160      */
161     @Test
162     @Alerts("[object HTMLBaseElement]")
163     public void base() throws Exception {
164         test("base");
165     }
166 
167     /**
168      * Test {@link org.htmlunit.html.HtmlBaseFont}.
169      *
170      * @throws Exception if an error occurs
171      */
172     @Test
173     @Alerts("[object HTMLElement]")
174     public void basefont() throws Exception {
175         test("basefont");
176     }
177 
178     /**
179      * Test {@link org.htmlunit.html.HtmlBidirectionalIsolation}.
180      *
181      * @throws Exception if an error occurs
182      */
183     @Test
184     @Alerts("[object HTMLElement]")
185     public void bdi() throws Exception {
186         test("bdi");
187     }
188 
189     /**
190      * Test {@link org.htmlunit.html.HtmlBidirectionalOverride}.
191      *
192      * @throws Exception if an error occurs
193      */
194     @Test
195     @Alerts("[object HTMLElement]")
196     public void bdo() throws Exception {
197         test("bdo");
198     }
199 
200     /**
201      * Test {@link org.htmlunit.html.HtmlBig}.
202      *
203      * @throws Exception if an error occurs
204      */
205     @Test
206     @Alerts("[object HTMLElement]")
207     public void big() throws Exception {
208         test("big");
209     }
210 
211     /**
212      * Test {@link org.htmlunit.html.HtmlBlink}.
213      *
214      * @throws Exception if an error occurs
215      */
216     @Test
217     @Alerts("[object HTMLUnknownElement]")
218     public void blink() throws Exception {
219         test("blink");
220     }
221 
222     /**
223      * Test {@link org.htmlunit.html.HtmlBlockQuote}.
224      *
225      * @throws Exception if an error occurs
226      */
227     @Test
228     @Alerts("[object HTMLQuoteElement]")
229     public void blockquote() throws Exception {
230         test("blockquote");
231     }
232 
233     /**
234      * Test {@link org.htmlunit.html.HtmlBody}.
235      *
236      * @throws Exception if an error occurs
237      */
238     @Test
239     @Alerts("[object HTMLBodyElement]")
240     public void body() throws Exception {
241         test("body");
242     }
243 
244     /**
245      * Test {@link org.htmlunit.html.HtmlBold}.
246      *
247      * @throws Exception if an error occurs
248      */
249     @Test
250     @Alerts("[object HTMLElement]")
251     public void b() throws Exception {
252         test("b");
253     }
254 
255     /**
256      * Test {@link org.htmlunit.html.HtmlBreak}.
257      *
258      * @throws Exception if an error occurs
259      */
260     @Test
261     @Alerts("[object HTMLBRElement]")
262     public void br() throws Exception {
263         test("br");
264     }
265 
266     /**
267      * Test {@link org.htmlunit.html.HtmlButton}.
268      *
269      * @throws Exception if an error occurs
270      */
271     @Test
272     @Alerts("[object HTMLButtonElement]")
273     public void button() throws Exception {
274         test("button");
275     }
276 
277     /**
278      * Test {@link org.htmlunit.html.HtmlCanvas}.
279      *
280      * @throws Exception if an error occurs
281      */
282     @Test
283     @Alerts("[object HTMLCanvasElement]")
284     public void canvas() throws Exception {
285         test("canvas");
286     }
287 
288     /**
289      * Test {@link org.htmlunit.html.HtmlCaption}.
290      *
291      * @throws Exception if an error occurs
292      */
293     @Test
294     @Alerts("[object HTMLTableCaptionElement]")
295     public void caption() throws Exception {
296         test("caption");
297     }
298 
299     /**
300      * Test {@link org.htmlunit.html.HtmlCenter}.
301      *
302      * @throws Exception if an error occurs
303      */
304     @Test
305     @Alerts("[object HTMLElement]")
306     public void center() throws Exception {
307         test("center");
308     }
309 
310     /**
311      * Test {@link org.htmlunit.html.HtmlCitation}.
312      *
313      * @throws Exception if an error occurs
314      */
315     @Test
316     @Alerts("[object HTMLElement]")
317     public void cite() throws Exception {
318         test("cite");
319     }
320 
321     /**
322      * Test {@link org.htmlunit.html.HtmlCode}.
323      *
324      * @throws Exception if an error occurs
325      */
326     @Test
327     @Alerts("[object HTMLElement]")
328     public void code() throws Exception {
329         test("code");
330     }
331 
332     /**
333      * Test {@link org.htmlunit.html.HtmlDataList}.
334      *
335      * @throws Exception if an error occurs
336      */
337     @Test
338     @Alerts("[object HTMLDataListElement]")
339     public void datalist() throws Exception {
340         test("datalist");
341     }
342 
343     /**
344      * Test {@link org.htmlunit.html.HtmlDefinition}.
345      *
346      * @throws Exception if an error occurs
347      */
348     @Test
349     @Alerts("[object HTMLElement]")
350     public void dfn() throws Exception {
351         test("dfn");
352     }
353 
354     /**
355      * Test {@link org.htmlunit.html.HtmlDefinitionDescription}.
356      *
357      * @throws Exception if an error occurs
358      */
359     @Test
360     @Alerts("[object HTMLElement]")
361     public void dd() throws Exception {
362         test("dd");
363     }
364 
365     /**
366      * Test {@link org.htmlunit.html.HtmlDefinitionList}.
367      *
368      * @throws Exception if an error occurs
369      */
370     @Test
371     @Alerts("[object HTMLDListElement]")
372     public void dl() throws Exception {
373         test("dl");
374     }
375 
376     /**
377      * Test {@link org.htmlunit.html.HtmlDefinitionTerm}.
378      *
379      * @throws Exception if an error occurs
380      */
381     @Test
382     @Alerts("[object HTMLElement]")
383     public void dt() throws Exception {
384         test("dt");
385     }
386 
387     /**
388      * Test {@link org.htmlunit.html.HtmlDeletedText}.
389      *
390      * @throws Exception if an error occurs
391      */
392     @Test
393     @Alerts("[object HTMLModElement]")
394     public void del() throws Exception {
395         test("del");
396     }
397 
398     /**
399      * Test {@link org.htmlunit.html.HtmlDirectory}.
400      *
401      * @throws Exception if an error occurs
402      */
403     @Test
404     @Alerts("[object HTMLDirectoryElement]")
405     public void dir() throws Exception {
406         test("dir");
407     }
408 
409     /**
410      * Test {@link org.htmlunit.html.HtmlDivision}.
411      *
412      * @throws Exception if an error occurs
413      */
414     @Test
415     @Alerts("[object HTMLDivElement]")
416     public void div() throws Exception {
417         test("div");
418     }
419 
420     /**
421      * Test {@link org.htmlunit.html.HtmlEmbed}.
422      *
423      * @throws Exception if an error occurs
424      */
425     @Test
426     @Alerts("[object HTMLEmbedElement]")
427     public void embed() throws Exception {
428         test("embed");
429     }
430 
431     /**
432      * Test {@link org.htmlunit.html.HtmlEmphasis}.
433      *
434      * @throws Exception if an error occurs
435      */
436     @Test
437     @Alerts("[object HTMLElement]")
438     public void em() throws Exception {
439         test("em");
440     }
441 
442     /**
443      * Test {@link org.htmlunit.html.HtmlExample}.
444      *
445      * @throws Exception if an error occurs
446      */
447     @Test
448     @Alerts("[object HTMLPreElement]")
449     public void xmp() throws Exception {
450         test("xmp");
451     }
452 
453     /**
454      * Test {@link org.htmlunit.html.HtmlFieldSet}.
455      *
456      * @throws Exception if an error occurs
457      */
458     @Test
459     @Alerts("[object HTMLFieldSetElement]")
460     public void fieldset() throws Exception {
461         test("fieldset");
462     }
463 
464     /**
465      * Test {@link org.htmlunit.html.HtmlFigure}.
466      *
467      * @throws Exception if an error occurs
468      */
469     @Test
470     @Alerts("[object HTMLElement]")
471     public void figure() throws Exception {
472         test("figure");
473     }
474 
475     /**
476      * Test {@link org.htmlunit.html.HtmlFigureCaption}.
477      *
478      * @throws Exception if an error occurs
479      */
480     @Test
481     @Alerts("[object HTMLElement]")
482     public void figcaption() throws Exception {
483         test("figcaption");
484     }
485 
486     /**
487      * Test {@link org.htmlunit.html.HtmlFont}.
488      *
489      * @throws Exception if an error occurs
490      */
491     @Test
492     @Alerts("[object HTMLFontElement]")
493     public void font() throws Exception {
494         test("font");
495     }
496 
497     /**
498      * Test {@link org.htmlunit.html.HtmlFooter}.
499      *
500      * @throws Exception if an error occurs
501      */
502     @Test
503     @Alerts("[object HTMLElement]")
504     public void footer() throws Exception {
505         test("footer");
506     }
507 
508     /**
509      * Test {@link org.htmlunit.html.HtmlForm}.
510      *
511      * @throws Exception if an error occurs
512      */
513     @Test
514     @Alerts("[object HTMLFormElement]")
515     public void form() throws Exception {
516         test("form");
517     }
518 
519     /**
520      * Test {@link org.htmlunit.html.HtmlFrame}.
521      *
522      * @throws Exception if an error occurs
523      */
524     @Test
525     @Alerts("[object HTMLFrameElement]")
526     public void frame() throws Exception {
527         test("frame");
528     }
529 
530     /**
531      * Test {@link org.htmlunit.html.HtmlFrameSet}.
532      *
533      * @throws Exception if an error occurs
534      */
535     @Test
536     @Alerts("[object HTMLFrameSetElement]")
537     public void frameset() throws Exception {
538         test("frameset");
539     }
540 
541     /**
542      * Test {@link org.htmlunit.html.HtmlHead}.
543      *
544      * @throws Exception if an error occurs
545      */
546     @Test
547     @Alerts("[object HTMLHeadElement]")
548     public void head() throws Exception {
549         test("head");
550     }
551 
552     /**
553      * Test {@link org.htmlunit.html.HtmlHeader}.
554      *
555      * @throws Exception if an error occurs
556      */
557     @Test
558     @Alerts("[object HTMLElement]")
559     public void header() throws Exception {
560         test("header");
561     }
562 
563     /**
564      * Test {@link org.htmlunit.html.HtmlHeading1}.
565      *
566      * @throws Exception if an error occurs
567      */
568     @Test
569     @Alerts("[object HTMLHeadingElement]")
570     public void h1() throws Exception {
571         test("h1");
572     }
573 
574     /**
575      * Test {@link org.htmlunit.html.HtmlHeading2}.
576      *
577      * @throws Exception if an error occurs
578      */
579     @Test
580     @Alerts("[object HTMLHeadingElement]")
581     public void h2() throws Exception {
582         test("h2");
583     }
584 
585     /**
586      * Test {@link org.htmlunit.html.HtmlHeading3}.
587      *
588      * @throws Exception if an error occurs
589      */
590     @Test
591     @Alerts("[object HTMLHeadingElement]")
592     public void h3() throws Exception {
593         test("h3");
594     }
595 
596     /**
597      * Test {@link org.htmlunit.html.HtmlHeading4}.
598      *
599      * @throws Exception if an error occurs
600      */
601     @Test
602     @Alerts("[object HTMLHeadingElement]")
603     public void h4() throws Exception {
604         test("h4");
605     }
606 
607     /**
608      * Test {@link org.htmlunit.html.HtmlHeading5}.
609      *
610      * @throws Exception if an error occurs
611      */
612     @Test
613     @Alerts("[object HTMLHeadingElement]")
614     public void h5() throws Exception {
615         test("h5");
616     }
617 
618     /**
619      * Test {@link org.htmlunit.html.HtmlHeading6}.
620      *
621      * @throws Exception if an error occurs
622      */
623     @Test
624     @Alerts("[object HTMLHeadingElement]")
625     public void h6() throws Exception {
626         test("h6");
627     }
628 
629     /**
630      * Test {@link org.htmlunit.html.HtmlHorizontalRule}.
631      *
632      * @throws Exception if an error occurs
633      */
634     @Test
635     @Alerts("[object HTMLHRElement]")
636     public void hr() throws Exception {
637         test("hr");
638     }
639 
640     /**
641      * Test {@link org.htmlunit.html.HtmlHtml}.
642      *
643      * @throws Exception if an error occurs
644      */
645     @Test
646     @Alerts("[object HTMLHtmlElement]")
647     public void html() throws Exception {
648         test("html");
649     }
650 
651     /**
652      * Test {@link org.htmlunit.html.HtmlImage}.
653      *
654      * @throws Exception if an error occurs
655      */
656     @Test
657     @Alerts("[object HTMLImageElement]")
658     public void img() throws Exception {
659         test("img");
660     }
661 
662     /**
663      * Test {@link org.htmlunit.html.HtmlImage}.
664      *
665      * @throws Exception if an error occurs
666      */
667     @Test
668     @Alerts(DEFAULT = "[object HTMLUnknownElement]",
669             FF = "[object HTMLElement]",
670             FF_ESR = "[object HTMLElement]")
671     public void image() throws Exception {
672         test("image");
673     }
674 
675     /**
676      * Test {@link org.htmlunit.html.HtmlInlineFrame}.
677      *
678      * @throws Exception if an error occurs
679      */
680     @Test
681     @Alerts("[object HTMLIFrameElement]")
682     public void iframe() throws Exception {
683         test("iframe");
684     }
685 
686     /**
687      * Test {@link org.htmlunit.html.HtmlInlineQuotation}.
688      *
689      * @throws Exception if an error occurs
690      */
691     @Test
692     @Alerts("[object HTMLQuoteElement]")
693     public void q() throws Exception {
694         test("q");
695     }
696 
697     /**
698      * Test {@link org.htmlunit.html.HtmlInput}.
699      *
700      * @throws Exception if an error occurs
701      */
702     @Test
703     @Alerts("[object HTMLInputElement]")
704     public void input() throws Exception {
705         test("input");
706     }
707 
708     /**
709      * Test {@link org.htmlunit.html.HtmlInsertedText}.
710      *
711      * @throws Exception if an error occurs
712      */
713     @Test
714     @Alerts("[object HTMLModElement]")
715     public void ins() throws Exception {
716         test("ins");
717     }
718 
719     /**
720      * Test {@link org.htmlunit.html.HtmlIsIndex}.
721      *
722      * @throws Exception if an error occurs
723      */
724     @Test
725     @Alerts("[object HTMLUnknownElement]")
726     public void isindex() throws Exception {
727         test("isindex");
728     }
729 
730     /**
731      * Test {@link org.htmlunit.html.HtmlItalic}.
732      *
733      * @throws Exception if an error occurs
734      */
735     @Test
736     @Alerts("[object HTMLElement]")
737     public void i() throws Exception {
738         test("i");
739     }
740 
741     /**
742      * Test {@link org.htmlunit.html.HtmlKeyboard}.
743      *
744      * @throws Exception if an error occurs
745      */
746     @Test
747     @Alerts("[object HTMLElement]")
748     public void kbd() throws Exception {
749         test("kbd");
750     }
751 
752     /**
753      * @throws Exception if an error occurs
754      */
755     @Test
756     @Alerts("[object HTMLUnknownElement]")
757     public void keygen() throws Exception {
758         test("keygen");
759     }
760 
761     /**
762      * Test {@link org.htmlunit.html.HtmlLabel}.
763      *
764      * @throws Exception if an error occurs
765      */
766     @Test
767     @Alerts("[object HTMLLabelElement]")
768     public void label() throws Exception {
769         test("label");
770     }
771 
772     /**
773      * Test {@link org.htmlunit.html.HtmlLegend}.
774      *
775      * @throws Exception if an error occurs
776      */
777     @Test
778     @Alerts("[object HTMLLegendElement]")
779     public void legend() throws Exception {
780         test("legend");
781     }
782 
783     /**
784      * Test {@link org.htmlunit.html.HtmlLink}.
785      *
786      * @throws Exception if an error occurs
787      */
788     @Test
789     @Alerts("[object HTMLLinkElement]")
790     public void link() throws Exception {
791         test("link");
792     }
793 
794     /**
795      * Test {@link org.htmlunit.html.HtmlListing}.
796      *
797      * @throws Exception if an error occurs
798      */
799     @Test
800     @Alerts("[object HTMLPreElement]")
801     public void listing() throws Exception {
802         test("listing");
803     }
804 
805     /**
806      * Test {@link org.htmlunit.html.HtmlListItem}.
807      *
808      * @throws Exception if an error occurs
809      */
810     @Test
811     @Alerts("[object HTMLLIElement]")
812     public void li() throws Exception {
813         test("li");
814     }
815 
816     /**
817      * Test {@link org.htmlunit.html.HtmlMain}.
818      *
819      * @throws Exception if an error occurs
820      */
821     @Test
822     @Alerts("[object HTMLElement]")
823     public void main() throws Exception {
824         test("main");
825     }
826 
827     /**
828      * Test {@link org.htmlunit.html.HtmlMap}.
829      *
830      * @throws Exception if an error occurs
831      */
832     @Test
833     @Alerts("[object HTMLMapElement]")
834     public void map() throws Exception {
835         test("map");
836     }
837 
838     /**
839      * Test {@link org.htmlunit.html.HtmlMark}.
840      *
841      * @throws Exception if an error occurs
842      */
843     @Test
844     @Alerts("[object HTMLElement]")
845     public void mark() throws Exception {
846         test("mark");
847     }
848 
849     /**
850      * Test {@link org.htmlunit.html.HtmlMarquee}.
851      *
852      * @throws Exception if an error occurs
853      */
854     @Test
855     @Alerts("[object HTMLMarqueeElement]")
856     public void marquee() throws Exception {
857         test("marquee");
858     }
859 
860     /**
861      * Test {@link org.htmlunit.html.HtmlMenu}.
862      *
863      * @throws Exception if an error occurs
864      */
865     @Test
866     @Alerts("[object HTMLMenuElement]")
867     public void menu() throws Exception {
868         test("menu");
869     }
870 
871     /**
872      * Test {@link org.htmlunit.html.HtmlMenuItem}.
873      *
874      * @throws Exception if an error occurs
875      */
876     @Test
877     @Alerts("[object HTMLUnknownElement]")
878     public void menuitem() throws Exception {
879         test("menuitem");
880     }
881 
882     /**
883      * Test {@link org.htmlunit.html.HtmlMeta}.
884      *
885      * @throws Exception if an error occurs
886      */
887     @Test
888     @Alerts("[object HTMLMetaElement]")
889     public void meta() throws Exception {
890         test("meta");
891     }
892 
893     /**
894      * Test {@link org.htmlunit.html.HtmlMeter}.
895      *
896      * @throws Exception if an error occurs
897      */
898     @Test
899     @Alerts("[object HTMLMeterElement]")
900     public void meter() throws Exception {
901         test("meter");
902     }
903 
904     /**
905      * Test {@link org.htmlunit.html.HtmlMultiColumn}.
906      *
907      * @throws Exception if an error occurs
908      */
909     @Test
910     @Alerts("[object HTMLUnknownElement]")
911     public void multicol() throws Exception {
912         test("multicol");
913     }
914 
915     /**
916      * Test {@link org.htmlunit.html.HtmlNav}.
917      *
918      * @throws Exception if an error occurs
919      */
920     @Test
921     @Alerts("[object HTMLElement]")
922     public void nav() throws Exception {
923         test("nav");
924     }
925 
926     /**
927      * Test {@link org.htmlunit.html.HtmlNextId}.
928      *
929      * @throws Exception if an error occurs
930      */
931     @Test
932     @Alerts("[object HTMLUnknownElement]")
933     public void nextid() throws Exception {
934         test("nextid");
935     }
936 
937     /**
938      * Test {@link org.htmlunit.html.HtmlNoBreak}.
939      *
940      * @throws Exception if an error occurs
941      */
942     @Test
943     @Alerts("[object HTMLElement]")
944     public void nobr() throws Exception {
945         test("nobr");
946     }
947 
948     /**
949      * Test {@link org.htmlunit.html.HtmlNoEmbed}.
950      *
951      * @throws Exception if an error occurs
952      */
953     @Test
954     @Alerts("[object HTMLElement]")
955     public void noembed() throws Exception {
956         test("noembed");
957     }
958 
959     /**
960      * Test {@link org.htmlunit.html.HtmlNoFrames}.
961      *
962      * @throws Exception if an error occurs
963      */
964     @Test
965     @Alerts("[object HTMLElement]")
966     public void noframes() throws Exception {
967         test("noframes");
968     }
969 
970     /**
971      * Test {@link org.htmlunit.html.HtmlNoScript}.
972      *
973      * @throws Exception if an error occurs
974      */
975     @Test
976     @Alerts("[object HTMLElement]")
977     public void noscript() throws Exception {
978         test("noscript");
979     }
980 
981     /**
982      * Test {@link org.htmlunit.html.HtmlObject}.
983      *
984      * @throws Exception if an error occurs
985      */
986     @Test
987     @Alerts("[object HTMLObjectElement]")
988     public void object() throws Exception {
989         test("object");
990     }
991 
992     /**
993      * Test {@link org.htmlunit.html.HtmlOption}.
994      *
995      * @throws Exception if an error occurs
996      */
997     @Test
998     @Alerts("[object HTMLOptionElement]")
999     public void option() throws Exception {
1000         test("option");
1001     }
1002 
1003     /**
1004      * Test {@link org.htmlunit.html.HtmlOptionGroup}.
1005      *
1006      * @throws Exception if an error occurs
1007      */
1008     @Test
1009     @Alerts("[object HTMLOptGroupElement]")
1010     public void optgroup() throws Exception {
1011         test("optgroup");
1012     }
1013 
1014     /**
1015      * Test {@link org.htmlunit.html.HtmlOrderedList}.
1016      *
1017      * @throws Exception if an error occurs
1018      */
1019     @Test
1020     @Alerts("[object HTMLOListElement]")
1021     public void ol() throws Exception {
1022         test("ol");
1023     }
1024 
1025     /**
1026      * Test {@link org.htmlunit.html.HtmlOutput}.
1027      *
1028      * @throws Exception if an error occurs
1029      */
1030     @Test
1031     @Alerts("[object HTMLOutputElement]")
1032     public void output() throws Exception {
1033         test("output");
1034     }
1035 
1036     /**
1037      * Test {@link org.htmlunit.html.HtmlParagraph}.
1038      *
1039      * @throws Exception if an error occurs
1040      */
1041     @Test
1042     @Alerts("[object HTMLParagraphElement]")
1043     public void p() throws Exception {
1044         test("p");
1045     }
1046 
1047     /**
1048      * Test {@link org.htmlunit.html.HtmlParameter}.
1049      *
1050      * @throws Exception if an error occurs
1051      */
1052     @Test
1053     @Alerts("[object HTMLParamElement]")
1054     public void param() throws Exception {
1055         test("param");
1056     }
1057 
1058     /**
1059      * Test {@link org.htmlunit.html.HtmlPlainText}.
1060      *
1061      * @throws Exception if an error occurs
1062      */
1063     @Test
1064     @Alerts("[object HTMLElement]")
1065     public void plaintext() throws Exception {
1066         test("plaintext");
1067     }
1068 
1069     /**
1070      * Test {@link org.htmlunit.html.HtmlPreformattedText}.
1071      *
1072      * @throws Exception if an error occurs
1073      */
1074     @Test
1075     @Alerts("[object HTMLPreElement]")
1076     public void pre() throws Exception {
1077         test("pre");
1078     }
1079 
1080     /**
1081      * Test {@link org.htmlunit.html.HtmlProgress}.
1082      *
1083      * @throws Exception if an error occurs
1084      */
1085     @Test
1086     @Alerts("[object HTMLProgressElement]")
1087     public void progress() throws Exception {
1088         test("progress");
1089     }
1090 
1091     /**
1092      * Test {@link org.htmlunit.html.HtmlRp}.
1093      *
1094      * @throws Exception if an error occurs
1095      */
1096     @Test
1097     @Alerts("[object HTMLElement]")
1098     public void rp() throws Exception {
1099         test("rp");
1100     }
1101 
1102     /**
1103      * Test {@link org.htmlunit.html.HtmlRt}.
1104      *
1105      * @throws Exception if an error occurs
1106      */
1107     @Test
1108     @Alerts("[object HTMLElement]")
1109     public void rt() throws Exception {
1110         test("rt");
1111     }
1112 
1113     /**
1114      * Test {@link org.htmlunit.html.HtmlRuby}.
1115      *
1116      * @throws Exception if an error occurs
1117      */
1118     @Test
1119     @Alerts("[object HTMLElement]")
1120     public void ruby() throws Exception {
1121         test("ruby");
1122     }
1123 
1124     /**
1125      * Test {@link org.htmlunit.html.HtmlS}.
1126      *
1127      * @throws Exception if an error occurs
1128      */
1129     @Test
1130     @Alerts("[object HTMLElement]")
1131     public void s() throws Exception {
1132         test("s");
1133     }
1134 
1135     /**
1136      * Test {@link org.htmlunit.html.HtmlSample}.
1137      *
1138      * @throws Exception if an error occurs
1139      */
1140     @Test
1141     @Alerts("[object HTMLElement]")
1142     public void samp() throws Exception {
1143         test("samp");
1144     }
1145 
1146     /**
1147      * Test {@link org.htmlunit.html.HtmlScript}.
1148      *
1149      * @throws Exception if an error occurs
1150      */
1151     @Test
1152     @Alerts("[object HTMLScriptElement]")
1153     public void script() throws Exception {
1154         test("script");
1155     }
1156 
1157     /**
1158      * Test {@link org.htmlunit.html.HtmlSection}.
1159      *
1160      * @throws Exception if an error occurs
1161      */
1162     @Test
1163     @Alerts("[object HTMLElement]")
1164     public void section() throws Exception {
1165         test("section");
1166     }
1167 
1168     /**
1169      * Test {@link org.htmlunit.html.HtmlSelect}.
1170      *
1171      * @throws Exception if an error occurs
1172      */
1173     @Test
1174     @Alerts("[object HTMLSelectElement]")
1175     public void select() throws Exception {
1176         test("select");
1177     }
1178 
1179     /**
1180      * Test {@link org.htmlunit.html.HtmlSmall}.
1181      *
1182      * @throws Exception if an error occurs
1183      */
1184     @Test
1185     @Alerts("[object HTMLElement]")
1186     public void small() throws Exception {
1187         test("small");
1188     }
1189 
1190     /**
1191      * Test {@link org.htmlunit.html.HtmlSource}.
1192      *
1193      * @throws Exception if an error occurs
1194      */
1195     @Test
1196     @Alerts("[object HTMLSourceElement]")
1197     public void source() throws Exception {
1198         test("source");
1199     }
1200 
1201     /**
1202      * Test {@link org.htmlunit.html.HtmlSpan}.
1203      *
1204      * @throws Exception if an error occurs
1205      */
1206     @Test
1207     @Alerts("[object HTMLSpanElement]")
1208     public void span() throws Exception {
1209         test("span");
1210     }
1211 
1212     /**
1213      * Test {@link org.htmlunit.html.HtmlStrike}.
1214      *
1215      * @throws Exception if an error occurs
1216      */
1217     @Test
1218     @Alerts("[object HTMLElement]")
1219     public void strike() throws Exception {
1220         test("strike");
1221     }
1222 
1223     /**
1224      * Test {@link org.htmlunit.html.HtmlStrong}.
1225      *
1226      * @throws Exception if an error occurs
1227      */
1228     @Test
1229     @Alerts("[object HTMLElement]")
1230     public void strong() throws Exception {
1231         test("strong");
1232     }
1233 
1234     /**
1235      * Test {@link org.htmlunit.html.HtmlStyle}.
1236      *
1237      * @throws Exception if an error occurs
1238      */
1239     @Test
1240     @Alerts("[object HTMLStyleElement]")
1241     public void style() throws Exception {
1242         test("style");
1243     }
1244 
1245     /**
1246      * Test {@link org.htmlunit.html.HtmlSubscript}.
1247      *
1248      * @throws Exception if an error occurs
1249      */
1250     @Test
1251     @Alerts("[object HTMLElement]")
1252     public void sub() throws Exception {
1253         test("sub");
1254     }
1255 
1256     /**
1257      * Test {@link org.htmlunit.html.HtmlSummary}.
1258      *
1259      * @throws Exception if an error occurs
1260      */
1261     @Test
1262     @Alerts("[object HTMLElement]")
1263     public void summary() throws Exception {
1264         test("summary");
1265     }
1266 
1267     /**
1268      * Test {@link org.htmlunit.html.HtmlSuperscript}.
1269      *
1270      * @throws Exception if an error occurs
1271      */
1272     @Test
1273     @Alerts("[object HTMLElement]")
1274     public void sup() throws Exception {
1275         test("sup");
1276     }
1277 
1278     /**
1279      * Test {@link org.htmlunit.html.HtmlSuperscript}.
1280      *
1281      * @throws Exception if an error occurs
1282      */
1283     @Test
1284     @Alerts("[object HTMLUnknownElement]")
1285     public void svg() throws Exception {
1286         test("svg");
1287     }
1288 
1289     /**
1290      * Test {@link org.htmlunit.html.HtmlTable}.
1291      *
1292      * @throws Exception if an error occurs
1293      */
1294     @Test
1295     @Alerts("[object HTMLTableElement]")
1296     public void table() throws Exception {
1297         test("table");
1298     }
1299 
1300     /**
1301      * Test {@link org.htmlunit.html.HtmlTableBody}.
1302      *
1303      * @throws Exception if an error occurs
1304      */
1305     @Test
1306     @Alerts("[object HTMLTableSectionElement]")
1307     public void tbody() throws Exception {
1308         test("tbody");
1309     }
1310 
1311     /**
1312      * Test {@link org.htmlunit.html.HtmlTableColumn}.
1313      *
1314      * @throws Exception if an error occurs
1315      */
1316     @Test
1317     @Alerts("[object HTMLTableColElement]")
1318     public void col() throws Exception {
1319         test("col");
1320     }
1321 
1322     /**
1323      * Test {@link org.htmlunit.html.HtmlTableColumnGroup}.
1324      *
1325      * @throws Exception if an error occurs
1326      */
1327     @Test
1328     @Alerts("[object HTMLTableColElement]")
1329     public void colgroup() throws Exception {
1330         test("colgroup");
1331     }
1332 
1333     /**
1334      * Test {@link org.htmlunit.html.HtmlTableDataCell}.
1335      *
1336      * @throws Exception if an error occurs
1337      */
1338     @Test
1339     @Alerts("[object HTMLTableCellElement]")
1340     public void td() throws Exception {
1341         test("td");
1342     }
1343 
1344     /**
1345      * Test {@link org.htmlunit.html.HtmlTableFooter}.
1346      *
1347      * @throws Exception if an error occurs
1348      */
1349     @Test
1350     @Alerts("[object HTMLTableSectionElement]")
1351     public void tfoot() throws Exception {
1352         test("tfoot");
1353     }
1354 
1355     /**
1356      * Test {@link org.htmlunit.html.HtmlTableHeader}.
1357      *
1358      * @throws Exception if an error occurs
1359      */
1360     @Test
1361     @Alerts("[object HTMLTableSectionElement]")
1362     public void thead() throws Exception {
1363         test("thead");
1364     }
1365 
1366     /**
1367      * Test {@link org.htmlunit.html.HtmlTableHeaderCell}.
1368      *
1369      * @throws Exception if an error occurs
1370      */
1371     @Test
1372     @Alerts("[object HTMLTableCellElement]")
1373     public void th() throws Exception {
1374         test("th");
1375     }
1376 
1377     /**
1378      * Test {@link org.htmlunit.html.HtmlTableRow}.
1379      *
1380      * @throws Exception if an error occurs
1381      */
1382     @Test
1383     @Alerts("[object HTMLTableRowElement]")
1384     public void tr() throws Exception {
1385         test("tr");
1386     }
1387 
1388     /**
1389      * Test {@link org.htmlunit.html.HtmlTrack}.
1390      *
1391      * @throws Exception if an error occurs
1392      */
1393     @Test
1394     @Alerts("[object HTMLTrackElement]")
1395     public void track() throws Exception {
1396         test("track");
1397     }
1398 
1399     /**
1400      * Test {@link org.htmlunit.html.HtmlTeletype}.
1401      *
1402      * @throws Exception if an error occurs
1403      */
1404     @Test
1405     @Alerts("[object HTMLElement]")
1406     public void tt() throws Exception {
1407         test("tt");
1408     }
1409 
1410     /**
1411      * Test {@link org.htmlunit.html.HtmlTextArea}.
1412      *
1413      * @throws Exception if an error occurs
1414      */
1415     @Test
1416     @Alerts("[object HTMLTextAreaElement]")
1417     public void textarea() throws Exception {
1418         test("textarea");
1419     }
1420 
1421     /**
1422      * Test {@link org.htmlunit.html.HtmlTime}.
1423      *
1424      * @throws Exception if an error occurs
1425      */
1426     @Test
1427     @Alerts("[object HTMLTimeElement]")
1428     public void time() throws Exception {
1429         test("time");
1430     }
1431 
1432     /**
1433      * Test {@link org.htmlunit.html.HtmlTitle}.
1434      *
1435      * @throws Exception if an error occurs
1436      */
1437     @Test
1438     @Alerts("[object HTMLTitleElement]")
1439     public void title() throws Exception {
1440         test("title");
1441     }
1442 
1443     /**
1444      * Test {@link org.htmlunit.html.HtmlUnderlined}.
1445      *
1446      * @throws Exception if an error occurs
1447      */
1448     @Test
1449     @Alerts("[object HTMLElement]")
1450     public void u() throws Exception {
1451         test("u");
1452     }
1453 
1454     /**
1455      * Test {@link org.htmlunit.html.HtmlUnorderedList}.
1456      *
1457      * @throws Exception if an error occurs
1458      */
1459     @Test
1460     @Alerts("[object HTMLUListElement]")
1461     public void ul() throws Exception {
1462         test("ul");
1463     }
1464 
1465     /**
1466      * Test {@link org.htmlunit.html.HtmlVariable}.
1467      *
1468      * @throws Exception if an error occurs
1469      */
1470     @Test
1471     @Alerts("[object HTMLElement]")
1472     public void var() throws Exception {
1473         test("var");
1474     }
1475 
1476     /**
1477      * Test {@link org.htmlunit.html.HtmlVideo}.
1478      *
1479      * @throws Exception if an error occurs
1480      */
1481     @Test
1482     @Alerts("[object HTMLVideoElement]")
1483     public void video() throws Exception {
1484         test("video");
1485     }
1486 
1487     /**
1488      * Test {@link org.htmlunit.html.HtmlWordBreak}.
1489      *
1490      * @throws Exception if an error occurs
1491      */
1492     @Test
1493     @Alerts("[object HTMLElement]")
1494     public void wbr() throws Exception {
1495         test("wbr");
1496     }
1497 
1498     /**
1499      * @throws Exception if an error occurs
1500      */
1501     @Test
1502     @Alerts("[object HTMLUnknownElement]")
1503     public void command() throws Exception {
1504         test("command");
1505     }
1506 
1507     /**
1508      * Test {@link org.htmlunit.html.HtmlDetails}.
1509      *
1510      * @throws Exception if an error occurs
1511      */
1512     @Test
1513     @Alerts("[object HTMLDetailsElement]")
1514     public void details() throws Exception {
1515         test("details");
1516     }
1517 
1518     /**
1519      * Test {@link org.htmlunit.html.HtmlDialog}.
1520      *
1521      * @throws Exception if an error occurs
1522      */
1523     @Test
1524     @Alerts("[object HTMLDialogElement]")
1525     public void dialog() throws Exception {
1526         test("dialog");
1527     }
1528 
1529     /**
1530      * @throws Exception if an error occurs
1531      */
1532     @Test
1533     @Alerts(DEFAULT = "[object HTMLUnknownElement]",
1534             CHROME = "[object HTMLElement]",
1535             EDGE = "[object HTMLElement]")
1536     public void layer() throws Exception {
1537         test("layer");
1538     }
1539 
1540     /**
1541      * @throws Exception if an error occurs
1542      */
1543     @Test
1544     @Alerts(DEFAULT = "[object HTMLUnknownElement]",
1545             CHROME = "[object HTMLElement]",
1546             EDGE = "[object HTMLElement]")
1547     public void nolayer() throws Exception {
1548         test("nolayer");
1549     }
1550 
1551     /**
1552      * @throws Exception if an error occurs
1553      */
1554     @Test
1555     @Alerts("[object HTMLElement]")
1556     public void rb() throws Exception {
1557         test("rb");
1558     }
1559 
1560     /**
1561      * @throws Exception if an error occurs
1562      */
1563     @Test
1564     @Alerts("[object HTMLUnknownElement]")
1565     public void rbc() throws Exception {
1566         test("rbc");
1567     }
1568 
1569     /**
1570      * @throws Exception if an error occurs
1571      */
1572     @Test
1573     @Alerts("[object HTMLElement]")
1574     public void rtc() throws Exception {
1575         test("rtc");
1576     }
1577 
1578     /**
1579      * @throws Exception if an error occurs
1580      */
1581     @Test
1582     @Alerts("[object HTMLUnknownElement]")
1583     public void spacer() throws Exception {
1584         test("spacer");
1585     }
1586 
1587     /**
1588      * Test {@link org.htmlunit.html.HtmlData}.
1589      *
1590      * @throws Exception if an error occurs
1591      */
1592     @Test
1593     @Alerts("[object HTMLDataElement]")
1594     public void data() throws Exception {
1595         test("data");
1596     }
1597 
1598     /**
1599      * Test HtmlContent.
1600      *
1601      * @throws Exception if an error occurs
1602      */
1603     @Test
1604     @Alerts("[object HTMLUnknownElement]")
1605     public void content() throws Exception {
1606         test("content");
1607     }
1608 
1609     /**
1610      * Test {@link org.htmlunit.html.HtmlPicture}.
1611      *
1612      * @throws Exception if an error occurs
1613      */
1614     @Test
1615     @Alerts("[object HTMLPictureElement]")
1616     public void picture() throws Exception {
1617         test("picture");
1618     }
1619 
1620     /**
1621      * Test {@link org.htmlunit.html.HtmlPicture}.
1622      *
1623      * @throws Exception if an error occurs
1624      */
1625     @Test
1626     @Alerts("[object HTMLTemplateElement]")
1627     public void template() throws Exception {
1628         test("template");
1629     }
1630 
1631     /**
1632      * Test {@link org.htmlunit.html.HtmlSlot}.
1633      *
1634      * @throws Exception if an error occurs
1635      */
1636     @Test
1637     @Alerts("[object HTMLSlotElement]")
1638     public void slot() throws Exception {
1639         test("slot");
1640     }
1641 
1642     /**
1643      * @throws Exception if the test fails
1644      */
1645     @Test
1646     @Alerts("[object HTMLUnknownElement]")
1647     public void arbitrary() throws Exception {
1648         test("abcdefg");
1649     }
1650 }