Selenium Java 小ネタ

input - text

		WebElement input = browser.findElement(ById.id("myId"));
		input.clear();
		input.sendKeys(value);
		WebElement input = browser.findElement(ByName.name("myName"));
		input.clear();
		input.sendKeys(value);

checkbox

		WebElement input = browser.findElement(ById.id("myId"));
		if (input.isSelected() != false) {
			input.click();
		}

select - option

		new Select(browser.findElement(By.id("myId"))).selectByValue("001");
		new Select(browser.findElement(By.id("myId"))).selectByVisibleText("特になし");