亚洲好骚综合-亚洲黄色录像-亚洲黄色网址-亚洲黄色网址大全-99久久99久久-99久久99久久精品国产

您的位置:軟件測試 > 開源軟件測試 > 開源功能測試工具 > Selenium
IE11不支持Selenium 2.0的解決方法
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2015/9/28 15:57:41 ] 推薦標(biāo)簽:功能測試工具 軟件測試工具

  題前話(Pre-words)
  希望使用Selenium 2.0的人看到這篇文章能夠收藏此文,以后遇到該問題,再也不用花費(fèi)多余的時間進(jìn)行research了!本文是對網(wǎng)上所有千奇百怪各種各樣的search結(jié)果所做的好總結(jié)。
  問題概述(Question)
  IE11不支持Selenium 2.0,在什么情況下不支持呢?比如:獲取通過WebDriver獲取頁面上的元素時,你經(jīng)常會捕獲到這樣的異常:
  OpenQA.Selenium.NoSuchWindowException: Unable to find element on closed window
  at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) in c:ProjectswebdriverdotnetsrcwebdriverRemoteRemoteWebDriver.cs:line 1139
  at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) in c:ProjectswebdriverdotnetsrcwebdriverRemoteRemoteWebDriver.cs:line 923
  at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value) in c:ProjectswebdriverdotnetsrcwebdriverRemoteRemoteWebDriver.cs:line 954
  at SharePoint_Automation.mainForm.waitUntilPageLoaded(IWebDriver iw, String eleID) in C:UsersAdministratordocumentsvisual studio 2015ProjectsSharePoint AutomationSharePoint AutomationForm1.cs:line 116
  上面這段異常的重點(diǎn)在于:
  OpenQA.Selenium.NoSuchWindowException: Unable to find element on closed window
  解決方案(Solution)
  經(jīng)過不屑的努力,終讓我找到了這一問題的解決方案如下(藍(lán)色字體為針對64bit計算機(jī)的終解決手段):
  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!并在其下創(chuàng)建一個DWORD,取名為:iexplore.exe,value為0。
  修改完你的注冊表后,重啟你的計算機(jī)。之后以管理員權(quán)限運(yùn)行Visual Studio,打開你的項目,運(yùn)行,你會發(fā)現(xiàn),問題解決了。
  Congratulations!這幾個小時沒有白費(fèi),終于讓我找到了解決方案!網(wǎng)上千奇百怪的說法很多,但是沒有一個好使的!
  希望看到這篇文章的人能夠收藏此文,以后遇到了這個問題,再也不用花費(fèi)多余的時間進(jìn)行research了!
  感謝以下兩篇文章:
  Selenium - NoSuchWindowException in IE 11
  InternetExplorerDriver
  另:
  若想正常使用WebDriver,請確保你的瀏覽器選項中security中各個zone的Protected Mode都是勾選著/非勾選著的,一定要統(tǒng)一才行!否則WebDriver將無法打開瀏覽器,會有如下異常:
  System.InvalidOperationException: Unexpected error launching Internet Explorer. Protected Mode settings are not the same for all zones. Enable Protected Mode must be set to the same value (enabled or disabled) for all zones. (NoSuchDriver)

軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd
主站蜘蛛池模板: www.亚洲国产 | 国产a一级毛片午夜剧场14 | 国产在线观看网址在线视频 | 成人永久免费 | 热热色网站 | 日本不卡视频在线 | 生活片毛片 | 久久er国产精品免费观看2 | 日本www色视频成人免费网站 | 波多野结衣中文字幕在线视频 | 一本三道a无线码一区v | 日韩欧美在线观看成人 | 欧美日韩一日韩一线不卡 | 成年大片免费高清在线观看 | 好男人在线社区www免费看 | 欧美日韩 国产区 在线观看 | 毛片高清| h片在线观看免费 | 亚洲一区二区三区在线免费观看 | 一个人看的www高清视频 | 黄色精品 | 中文字幕高清免费不卡视频 | 国产精品视_精品国产免费 国产精品视频a | 日本大臿亚洲香蕉大片 | 久久婷婷五月综合色丁香 | 欧美日韩综合高清一区二区 | 亚洲伊人天堂 | 亚洲欧美一区二区三区国产精品 | ww7788色淫网站女女免费 | 黄色网址视频免费 | 日韩免费在线视频 | 成人羞羞国产免费软件 | 国产男女猛烈无遮挡 | 免费观看日批视频 | 成人a毛片 | 日日热| 黄网址在线观看 | 性无遮挡高清视频免费 | 亚洲毛片在线观看 | 久久精品国产精品亚洲综合 | 成 人在线观看视频网站 |