问题:页面代码中不存在target="_blank",怎么实现点击一个按钮,在新窗口中打开?
WebElement link = element.findElement(By.tagName("a"));
String href = link.getAttribute("href");
JavascriptExecutor executor = (JavascriptExecutor) driver;
executor.executeScript("window.open('" + href + "')");

最新文章

  1. CICS的几个常用命令
  2. tomcat7 Could not load the Tomcat server configuration at /Servers/Tomcat v7.0 Server at localhost-config. The configuration may be corrupt or incomplete
  3. AC日记——忽略大小写的字符串比较 openjudge 1.7 16
  4. 主流IM协议简介
  5. 使用Sublime Text 直接运行Quick-cocos2d-x 项目
  6. windows下的socket网络编程(入门级)
  7. 项“XXXXX.sln”已在选择的位置受源代码管理
  8. 给 Xamarin.Form For Windows Phone APP 加个漂亮的 "头"
  9. ./configure会报错:pr command not found
  10. Web体系=资源+URI+表示
  11. UML 中的用例图解析以及starUML详细介绍
  12. iOS获取文件和文件夹大小
  13. Adobe Acrobat XI Pro安装破解
  14. day04
  15. SQL中的cast()函数
  16. XtraBackup应用说明(支持TokuDB)
  17. JavaScript核心--Function
  18. 全景3d
  19. GPS卫星定位防盗系统机芯
  20. WIN10系统如何取消右下角的通知菜单,通知图标

热门文章

  1. PHP开发环境配置系列(四)-XAMPP常用信息
  2. mysql explain分析列名
  3. 管理 node 版本,选择 nvm 还是 n?
  4. zabbix自定义监控项一
  5. 2017.7.25 jqGrid在编辑态无法获取数据,得到的是html代码
  6. spring 配置多数据源 (可行)
  7. PS 如何制作球面化文字效果
  8. Oracle基础 PL-SQL编程基础(3) 循环结构
  9. Linux——vi命令的使用
  10. eclipse maven tools.jar找不到y也就是在这个