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.
package temp; //from w w w . j a v a 2 s . c o m import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; public class UserOperationsHelper { private WebDriver driver; private String baseUrl = "https://passport.csdn.net"; public UserOperationsHelper(WebDriver driver) { this.driver = driver; } public void logOn(String username, String password) throws CaseErrorException { // string.Empty????????????? if (username == null) throw new CaseErrorException(new IllegalArgumentException( "username")); if (password == null) throw new CaseErrorException(new IllegalArgumentException( "password")); driver.get(baseUrl + "/account/login"); driver.findElement( By.id(Constants.??????.????????)).clear(); driver.findElement( By.id(Constants.??????.????????)).sendKeys(username); driver.findElement( By.id(Constants.??????.??????)).clear(); driver.findElement( By.id(Constants.??????.??????)).sendKeys(password); driver.findElement( By.id(Constants.??????.????????)).click(); driver.findElement( By.cssSelector(Constants.??????.????)).click(); } }