selenium 远程调用浏览器
2024-08-26 18:58:31
共分三步:
1.selenium官网下载selenium-server-standalone.jar的最新版本号
2.启动selenium-server:::::
java
-jar "selenium-server-standalone-2.2.0.jar"
-Dwebdriver.firefox.bin="C:\FirefoxCollection\Mozilla
Firefox 36.0\firefox.exe"
3.java代码初始化webdriver对象时:
DesiredCapabilities
capabilities = new DesiredCapabilities("firefox", "", Platform.ANY);
driver=new RemoteWebDriver(new URL("http://127.0.0.1:4444/wd/hub/"),capabilities);
Ps:假设是调用本地的浏览器的话,
System.setProperty("webdriver.firefox.bin",
"F:\\InstalledFiles\\firefox\\firefox.exe");
WebDriver
driver = new FirefoxDriver(); 就可以
最新文章
- hadoop小试
- 【编程题目】在一个字符串中找到第一个只出现一次的字符。如输入 abaccdeff,则输出 b。
- Plugins
- SSH乱码解决
- djangoadmin导出csv
- Windows 7 的系统文件修复:sfc /scannow
- Contoso 大学 - 1 - 为 ASP.NET MVC 应用程序创建 EF 数据模型
- 【HDOJ】1494 跑跑卡丁车
- SAP HANA 中的决策表(Decision Table)
- Javascript Fromdata 与jQuery 实现Ajax文件上传以及文件的删除
- jQuery获取Select选择的Text和 Value(转,待测试确认)
- [1] Entity Framework / Code First
- C++11智能指针的深度理解
- Visual Studio Code Shortcuts
- py001
- CSS3动画与JS动画的优缺点?
- SharePoint如何配置Ipad跳转等问题
- python中使用os.path.join()
- 你应该掌握的C++ RAII手法:Scopegaurd
- vs2012添加自定义资源步骤
热门文章
- Java中ArrayList和LinkedList差别
- MongoDB学习笔记(六) MongoDB索引用法和效率分析
- hdu 4550 贪婪 思考题 权
- SAP自带的创建报表工具
- 使用gdb调试游戏服务器
- c# listview导出excel文件
- 14.3.3 Locks Set by Different SQL Statements in InnoDB 不同的SQL语句在InnoDB里的锁设置
- poj 2409+2154+2888(Burnside定理)
- remove()和直接使用system的一个差别
- 明晚8点,捷微团队QQ群公开课,解说jeewx2.0版本号maven环境的搭建入门!