selenium c# 的注意事项
http://chromedriver.storage.googleapis.com/index.html chromedriver的下载地址
http://selenium-release.storage.googleapis.com/index.html IEdriver的下载地址
https://github.com/mozilla/geckodriver/releases firefoxdriver的下载地址
问题积累:
1. 关于IE11不能定位的问题:解决方案:
For IE 11 only, you will need to set a registry entry on the target computer so that the driver can maintain a connection to the instance of Internet Explorer it creates. (这段告诉你需要修改注册表。)
For 32-bit Windows installations, the key you must examine in the registry editor is HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. (32bit Windows看这里。)
For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE. Please note that the FEATURE_BFCACHE subkey may or may not be present, and should be created if it is not present. Important: Inside this key, create a DWORD value named iexplore.exe with the value of 0.(64bit Windows看这里。)
翻译过来的意思即,修改你的注册表(Run->regedit->Enter),路径如下:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BFCACHE
如果FeatureControl下没有FEATURE_BFCACHE,就以FEATURE_BFCACHE为名new一个key!并在其下创建一个DWORD,取名为:iexplore.exe,value为0。
2. IE的click无效的解决方案:
使用模拟js点击:
((IJavaScriptExecutor)driver).ExecuteScript("arguments[0].click();", driver.FindElement(By.TagName("button")));
3. IE的sendkeys慢的解决方案:
IE的64位driver有bug,使用32位的driver
4. firefox中sendkeys报错的问题
firefox的版本问题,使用52版本的firefox可以解决
最新文章
- Golang(笔记) 顺序编程
- 扫描内网活跃的ip
- FLASH结构
- Swift使用注意
- Js注册等待
- 获取win7时区所有信息
- iOS证书快要过期怎么办?
- 面向服务的体系架构 SOA(三) --- Zookeeper API、zkClient API的使用
- kaldi chain模型的序列鉴别性训练代码分析
- QTCPSOCKET 客户端已连接 而服务器无响应
- python获取公网ip,本地ip及所在国家城市等相关信息收藏
- delphi Form属性设置 设置可实现窗体无最大化,并且不能拖大拖小
- linux系统中关于shell变量$*与$@的区别
- Query实例的ajax应用之二级联动的后台是采用php来做的
- 【HNOI2017】单旋
- 1、hadoop HA分布式集群搭建
- February 2 2017 Week 5 Thursday
- Java实验二实验报告:java面向对象程序设计
- [Exception Android 22] - Could not find com.android.support:design:23.1.1
- iptables配置顺序-两条规则会忽略后边的
热门文章
- ubuntu切割mp3文件
- JQuery学习四(过滤选择器)
- android 布局文件中控件ID、name标签属性的命名包含“@”、“.”、“+”等等符号的含义
- Java的Comparable接口的一个陷阱
- table第一行合并,其余行宽度失效问题
- 为select2下拉框赋值
- [USACO09DEC] Cow Toll Paths
- 洛谷P2860 [USACO06JAN]冗余路径Redundant Paths
- 图书馆排序(Library Sort)
- 【NOIP】提高组2015 跳石头