Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在弹出窗口中自动编写文本。是否可以?如果是,请指导我。任何帮助将不胜感激。
如果是浏览器弹出窗口,听起来您正在寻找:
driver.switchTo().alert().sendKeys("some text to enter");
我得到了解决方案:
driver.switchTo().frame(0); driver.findElement(By.id("id of the view to enter text in the popup")).sendKeys("some text to enter");