selenium实现在新窗口打开链接
2024-09-07 18:13:13
问题:页面代码中不存在target="_blank",怎么实现点击一个按钮,在新窗口中打开?
WebElement link = element.findElement(By.tagName("a"));
String href = link.getAttribute("href");
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("window.open('" + href + "')");
最新文章
- CICS的几个常用命令
- tomcat7 Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete
- AC日记——忽略大小写的字符串比较 openjudge 1.7 16
- 主流IM协议简介
- 使用Sublime Text 直接运行Quick-cocos2d-x 项目
- windows下的socket网络编程(入门级)
- 项“XXXXX.sln”已在选择的位置受源代码管理
- 给 Xamarin.Form For Windows Phone APP 加个漂亮的 ";头";
- ./configure会报错:pr command not found
- Web体系=资源+URI+表示
- UML 中的用例图解析以及starUML详细介绍
- iOS获取文件和文件夹大小
- Adobe Acrobat XI Pro安装破解
- day04
- SQL中的cast()函数
- XtraBackup应用说明(支持TokuDB)
- JavaScript核心--Function
- 全景3d
- GPS卫星定位防盗系统机芯
- WIN10系统如何取消右下角的通知菜单,通知图标