public void Test003() {
new Select (webDriver.findElement(By.cssSelector("select"))).selectByVisibleText("NEC_COCONA_GG3");
webDriver.manage().timeouts().implicitlyWait(1,TimeUnit.MILLISECONDS);
webDriver.findElement(By.xpath("//div[@id='main-menu']/ul/li[5]/a")).click();
webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.MILLISECONDS);
webDriver.findElement(By.id("issue_subject")).sendKeys("Test");
webDriver.findElement(By.id("issue_description")).sendKeys("Test");
webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.MILLISECONDS);
new Select(webDriver.findElement(By.id("issue_assigned_to_id"))).selectByVisibleText("<<me>>");
webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.MILLISECONDS);
new Select(webDriver.findElement(By.id("issue_custom_field_values_7"))).selectByVisibleText("QA");
webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.MILLISECONDS);
webDriver.findElement(By.id("issue_custom_field_values_27")).sendKeys("Test");
webDriver.findElement(By.xpath("//*[@id='attachments_fields']/span/input[1]")).sendKeys("D:\\NEC new\\log\\EASCrash.txt");
webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.MILLISECONDS);
webDriver.findElement(By.xpath("//*[@id='attachments_form']/span[2]/a")).click();
webDriver.findElement(By.xpath("//*[@id='attachments_fields']/span[2]/input[1]")).sendKeys("D:\\NEC new\\log\\crash_info_201304171712.txt");
webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.MILLISECONDS);
webDriver.findElement(By.xpath("//input[@name='issue[watcher_user_ids][]' and @value='102']")).click();
webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.MILLISECONDS);
webDriver.findElement(By.xpath("//*[@id='issue-form']/input[1]")).click();
webDriver.manage().timeouts().implicitlyWait(3,TimeUnit.MILLISECONDS);
}
运行脚本 selenium 时无法获取
new Select (webDriver.findElement(By.cssSelector("select"))).selectByVisibleText("NEC_COCONA_GG3");
选择失败的测试用例。
显示的错误是:
org.openqa.selenium.WebDriverException: Driver does not support finding an element by selector: select