zoukankan      html  css  js  c++  java
  • 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_MACHINESOFTWAREMicrosoftInternet ExplorerMainFeatureControlFEATURE_BFCACHE. (32bit Windows看这里。)

    For 64-bit Windows installations, the key is HKEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_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_MACHINESOFTWAREWow6432NodeMicrosoftInternet ExplorerMainFeatureControlFEATURE_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可以解决

  • 相关阅读:
    oracle 用户密码过期
    求字符串的长度
    oracle 行列装置
    SQL Server 2005参考:PIVOT
    SOAP 入门
    SQL Server 2005参考:数据汇总
    Silverlight 参考: 几何图形 MSDN
    jQuery参考:jquery中的$(document).ready()与window.onload的区别
    Silverlight开源项目与第三方控件收集
    Silverlight 项目开发准则参考
  • 原文地址:https://www.cnblogs.com/Teddy/p/6841460.html
Copyright © 2011-2022 走看看