Back to project page androidtestdebug.
The source code is released under:
MIT License
If you think the Android project androidtestdebug listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
import java.util.concurrent.TimeUnit; import org.junit.*; import static org.junit.Assert.*; import org.openqa.selenium.*; import org.openqa.selenium.firefox.FirefoxDriver; //from w w w.j a va2 s . c o m public class FirstDemo { private WebDriver driver; private String baseUrl; private StringBuffer verificationErrors = new StringBuffer(); @Before public void setUp() throws Exception { driver = new FirefoxDriver(); baseUrl = "http://www.baidu.com/"; driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); } @Test public void testFirstDemo() throws Exception { driver.get(baseUrl + "/"); driver.findElement(By.id("kw")).click(); driver.findElement(By.id("kw")).clear(); driver.findElement(By.id("kw")).sendKeys("selenium"); driver.findElement(By.id("su")).click(); } @After public void tearDown() throws Exception { driver.quit(); String verificationErrorString = verificationErrors.toString(); if (!"".equals(verificationErrorString)) { fail(verificationErrorString); } } }