0

我在啓動量角器代碼時遇到問題。量角器:意外的錯誤啓動Internet Explorer。所有區域的保護模式設置不同

下面是我使用的代碼:

conf.js與下面的代碼

// An example configuration file. 
exports.config = { 
// The address of a running selenium server. 
seleniumAddress: 'http://localhost:4444/wd/hub', 
// Capabilities to be passed to the webdriver instance. 
capabilities: { 
    // 'browserName': 'chrome' 
    'browserName': 'internet explorer' 
}, 

// Spec patterns are relative to the current working directly when 
// protractor is called. 
specs: ['example_spec.js'], 

// Options to be passed to Jasmine-node. 
    allScriptsTimeout: 500000, 
jasmineNodeOpts: { 
    onComplete: null, 
    isVerbose: true, 
    showColors: true, 
    includeStackTrace: true, 
    defaultTimeoutInterval: 1000000 
} 
}; 

sample_class.js文件與下面的代碼:

describe('angularjs homepage title check', function() { 
     it('should have a title', function() { 
      console.log('Step 1'); 
      browser.get('http://google.com'); 
      expect(browser.getTitle()).toEqual('My Todolist Page'); 
     }); 

而且有我用來啓動的命令

  1. 安裝量角器--ie
  2. webdriver的經理節點JS
  3. webdriver的經理更新開始

請不要建議我改變IE瀏覽器的設置,因爲它被禁用。讓我知道,如果像新的一樣

InternetExplorerOptions() { IntroduceInstabilityByIgnoringProtectedModeSettings = true} in selenium. 

感謝

+0

嗨Manoj歡迎來到Stackoverflow。這段代碼有什麼問題或問題? – Janusz

+0

正如我在標題中提到的,我無法通過量角器啓動IE瀏覽器。我在控制檯 – Manoj

回答

0

這裏沒有其他解決辦法是回答你的問題:

當你與Selenium 3.4.0工作,IEDriverServer 3.4.0IE(v 10/11),你可以考慮配置一對夫婦屬性爲IE的工作如下:

隨着設置,

InternetExplorerOptions() { IntroduceInstabilityByIgnoringProtectedModeSettings = true} 

考慮以下幾點:

  1. Protected Mode設置:在IE 7或更高版本的Windows Vista或Windows 7,你必須爲每個區域的保護模式設置爲相同的值。該值可以打開或關閉,只要每個區域的值相同即可。要設置保護模式設置,請從工具菜單中選擇「Internet選項...」,然後單擊安全選項卡。對於每個區域,標籤底部將顯示一個複選框,標記爲「啓用保護模式」
  2. Zoom Level:將Zoom Level設置爲100% IE正常工作。
  3. 添加以下InternetExplorerOptions()

    { ignoreProtectedModeSettings = true} 
    { nativeEvents = true} 
    { ignoreZoomSetting = true} 
    { requireWindowFocus = true} 
    { INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS = true} 
    
  4. 櫃面IE11的:另外,你必須要考慮的註冊表項文件here

讓我知道這個答案是否是您的問題。

+0

上收到「意外的錯誤啓動Internet Explorer。所有區域的保護模式設置不一樣」錯誤感謝您的回覆。這不會有幫助。我在量角器c#中查找以上解決方案,而不是硒 – Manoj

相關問題