Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package jp.co.iti.test;
import junit.framework.Assert;
import io.selendroid.SelendroidCapabilities;
import io.selendroid.SelendroidDriver;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.DesiredCapabilities;
public class SelendroidTest {
private WebDriver driver = null;
@Test
public void inputField() {
WebElement inputField = driver.findElement(By.id("my_text_field"));
Assert.assertEquals("true", inputField.getAttribute("enabled"));
inputField.sendKeys("Selendroid");
Assert.assertEquals("Selendroid", inputField.getText());
driver.quit();
}
@Before
public void setup() throws Exception {
DesiredCapabilities caps = new SelendroidCapabilities("io.selendroid.testapp:0.10.0");
driver = new SelendroidDriver(caps);
}
@After
public void teardown() {
if (driver != null) {
driver.quit();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.