页面元素textarea定位不到,请高手指教
WebDriver driver = new ChromeDriver();driver.get("http://192.168.1.211/qmysxt211/");
driver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);
driver.findElement(By.id("txtuid")).sendKeys("SYS");
driver.findElement(By.id("txtpwd")).sendKeys("ADMIN");
driver.findElement(By.id("bytton1")).click();
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
driver.findElement(By.xpath("//*[@id='_easyui_tree_30']/span")).click();
WebElement iframe = driver.findElement(By.name("mainFrame"));
driver.switchTo().frame(iframe);
WebElement textarea = driver.findElement(By.xpath("//*[@id='Txteartgxx']"));
textarea.clear();
textarea.sendKeys("欢迎您登陆");
源码:
driver.findElement(By.xpath("//*[@id='_easyui_tree_30']/span")).click();在这句后面加个等待时间试试 怎么定位不到了 报错信息也不发一下
页:
[1]