在新窗口中输入登录名和密码

时间:2013-04-17 22:00:03

标签: selenium-webdriver

我正在使用selenium webdriver在Facebook上创建电影和分享它。在facebook登录窗口打开后我被困住了。你能告诉我如何输入电子邮件和密码以完成测试。我是selenium的新手

1 个答案:

答案 0 :(得分:0)

首先,您需要在互联网上查看。 其次,在发布这样的问题之前尝试一些技巧。

因此,您需要捕获输入字段,如:

WebElement inputName = driver.findElement(By.id("id of the input"));
inputName.sendKeys("freezer123@hotmail.com");

WebElement inputPassword = driver.findElement(By.id("id of the input"));
inputPassword.sendKeys("pass1234");

WebElement btnOk = driver.findElement(By.id("id of the button"));
btnOk.click();

看看here