public class LoginPage {
private final WebDriver driver;
public LoginPage(WebDriver driver)
{
this.driver = driver;
}
public void loginAs(String username, String password)
{
/* driver.get("https://login.salesforce.com/?locale=uk");
driver.manage().timeouts().implicitlyWait(05, TimeUnit.SECONDS);
System.out.println("READ");
// System.out.println(driver.findElement(By.id("pwcaps")).getText());
//driver.findElement(By.id(username)).sendKeys("sambit");
//driver.findElement(By.className(password)).sendKeys("PWD");
//driver.findElement(By.id(username)).sendKeys("Password");
/*if (driver.findElement(By.className("loginButton")).isEnabled())
{
System.out.println("entered If loop");
System.out.println("login Button is enabled");
driver.findElement(By.className("loginButton")).click();
}
else
{
driver.close();
}*/
if (driver.findElement(By.id("Account_Tab")).isEnabled())
{
System.out.println("Account tab is enabled");
}
else
{
System.out.println("Account tab is not enabled");
}
}
public static void main(String[] args){
// TODO Auto-generated method stub
LoginPage login = new LoginPage(new InternetExplorerDriver());
login.loginAs("sambit.sabyasachi", "check");
}
网页显示此字段不启用自动填写表格