2017-04-18 10 views
0

て私は以下のようにRobotFrameworkを通じてInPrivateモードでIEを開くしようとしています:スクリプトはCtrlキー+ Cを押すまで、最後のステップで立ち往生しているInternet Explorerを開きrobotframework

${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.INTERNETEXPLORER sys, selenium.webdriver 
Log To Console ${dc} 
Set To Dictionary ${dc} ie.forceCreateProcessApi=${True} ie.browserCommandLineSwitches=-private 
Log To Console ${dc} 
Open Browser www.google.com ie desired_capabilitie=${dc} 

。誰もが問題を解決する方法を知っていますか?

ありがとうございました!

+0

私のシステムで問題が見つかりました。私のWindows 64ビットでIEDriverServer 32ビットを使用すると問題が発生します。 – ttvn

答えて

0

次のコードは、私の作品:

*** Settings *** 
Library Collections  
Library Selenium2Library 

*** Test Cases *** 
Test IE InPrivate 
    ${dc} Evaluate sys.modules['selenium.webdriver'].DesiredCapabilities.INTERNETEXPLORER sys, selenium.webdriver 
    Set To Dictionary ${dc} ignoreProtectedModeSettings ${True} 
    Set To Dictionary ${dc} ie.forceCreateProcessApi  ${True} 
    Set To Dictionary ${dc} ie.browserCommandLineSwitches=-private 
    Open Browser www.google.com ie desired_capabilitie=${dc} 

しかし、forceCreateProcessApiためには、追加のレジストリキーを動作するように設定すると、追加する必要があることに注意してください:HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\TabProcGrowth = '0'。それ以外の場合、次のエラーが表示されます。

WebDriverException: Message: Unexpected error launching Internet Explorer. Unable to use 
CreateProcess() API. To use CreateProcess() with Internet Explorer 8 or higher, the value 
of registry setting in 
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main\TabProcGrowth must be '0'. 
+0

ありがとう、A. Kootstra。それも私のために働く。 – ttvn

+0

似たような問題を抱えている他の人がそれをより簡単に認識できるように、この回答に答えとしてマークすることはできますか? –