1 38 package com.gargoylesoftware.htmlunit.html; 39 40 import com.gargoylesoftware.htmlunit.WebTestCase; 41 42 49 public class HtmlRadioButtonInputTest extends WebTestCase { 50 55 public HtmlRadioButtonInputTest( final String name ) { 56 super( name ); 57 } 58 59 63 public void test_asTextWhenNotChecked() throws Exception { 64 final String htmlContent 65 = "<html><head><title>foo</title></head><body>" 66 + "<form id='form1'>" 67 + " <input type='radio' name='radio' id='radio'>Check me</input>" 68 + "</form></body></html>"; 69 70 final HtmlPage page = loadPage(htmlContent); 71 72 final HtmlRadioButtonInput radio = (HtmlRadioButtonInput) page.getHtmlElementById("radio"); 73 assertEquals("unchecked", radio.asText()); 74 radio.setChecked(true); 75 assertEquals("checked", radio.asText()); 76 } 77 } 78 | Popular Tags |