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

相关问题