package misc;

import static org.junit.Assert.fail;
import jp.sourceforge.cfneo.at4ie2.TestSupport;

import org.junit.Test;

import watij.elements.Radio;
import watij.elements.Radios;
import watij.finders.SymbolFactory;
import watij.runtime.ie.IE;

public class WatijTest1 {

	@Test
	public void test() {
		try {
			IE ie = new IE();
			ie.start(TestSupport.TARGET_PATH + TestSupport.TARGET_FILE);

			Radio r1 = ie.radio(SymbolFactory.id , "rd1");
			System.out.println(r1.html());

			Radio r2 = ie.radio(SymbolFactory.name , "radio1");
			System.out.println(r2.html());

			Radio r3 = ie.radio(SymbolFactory.id , "rd2");
			System.out.println(r3.html());

			Radios radios = ie.radios(SymbolFactory.name, "radio1");
			for (Radio radio: radios) {
				System.out.println(radio.value());
			}

			System.out.println("total=" + ie.radios().length());
			System.out.println("radio1=" + ie.radios(SymbolFactory.name, "radio1").length());

			ie.close();
		} catch (Exception e) {
			e.printStackTrace();
			fail();
		}
	}

}
