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