【发布时间】:2014-04-09 04:26:12
【问题描述】:
我需要将值发送到此弹出窗口。这是在同一个窗口中打开的。当我尝试使用普通的 driver.findelement 时,它收到错误消息说找不到 xpath 这是我的代码
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
public class Homepage_login {
public static void main(String[] args) {
// TODO Auto-generated method stub
FirefoxDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
//driver.get("http://se.rdmsonline.net/login.aspx");
driver.get("http://se.rdmsonline.net/");
driver.findElement(By.xpath("//*[@id='rcmLang_Arrow']")).click();
driver.findElement(By.xpath("//*[@id='rcmLang_DropDown']/div/ul/li[2]")).click();
driver.findElement(By.xpath("//*[@id='txtUserName']")).sendKeys(" ");
driver.findElement(By.xpath("//*[@id='txtPassword']")).sendKeys(" ");
driver.findElement(By.xpath("//*[@id='btnLogin']")).click();
driver.findElement(By.xpath("//*[@id='Div1']/div/a")).click();
driver.findElement(By.xpath("//*[@id='txtUserName']")).sendKeys(" ");
driver.findElement(By.xpath("//*[@id='txtPassword']")).sendKeys(" ");
driver.findElement(By.xpath("//*[@id='btnLogin']")).click();
driver.findElement(By.xpath("//*[@id='rptSec_ctl00_imb']")).click();
driver.findElement(By.xpath("//*[@id='ctl00_Menu5']")).click();
driver.findElement(By.xpath("//*[@id='ctl00_cpl1_lnkNewNotification']")).click();
driver.findElement(By.xpath("//*[@id='ctl00_cplm_dtpDate_dateInput_text']")).sendKeys(" ");
}
}
这是在弹出窗口中发送控件..有人可以帮助我吗?
【问题讨论】:
-
我试图附上截图阿米特,因为我是新进入的,我没有10个声望。所以我不能添加图像。我分享代码。如果你运行代码,那么你可以看到我的停止点
标签: java selenium selenium-webdriver