0

启动量角器时遇到问题。

下面是我正在使用的代码:

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. 安装量角器和节点js
  2. webdriver-manager 更新 --ie
  3. webdriver-manager 启动

我正在 Selenium 中寻找可行的解决方案,例如:

InternetExplorerOptions() { IntroduceInstabilityByIgnoringProtectedModeSettings = true} in selenium.

谢谢

4

1 回答 1

0

这是您的问题的答案:

当您使用Selenium 3.4.0, IEDriverServer 3.4.0with 时IE(v 10/11),您可以考虑为 IE 配置几个属性,如下所示:

随着设置,

InternetExplorerOptions() { IntroduceInstabilityByIgnoringProtectedModeSettings = true}

考虑以下:

  1. Protected Mode设置:在 Windows Vista 或 Windows 7 上的 IE 7 或更高版本上,您必须将每个区域的保护模式设置设置为相同的值。该值可以打开或关闭,只要每个区域都相同。要设置保护模式设置,请从“工具”菜单中选择“Internet 选项...”,然后单击“安全”选项卡。对于每个区域,标签底部都会有一个复选框,标签为“启用保护模式”
  2. Zoom Level:设置Zoom Level100%以使 IE 正常工作。
  3. 添加以下内容InternetExplorerOptions()

    { ignoreProtectedModeSettings = true}
    { nativeEvents = true}
    { ignoreZoomSetting = true}
    { requireWindowFocus = true}
    { INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS = true}
    
  4. Incase IE11:此外,您必须考虑此处记录的注册表项。

让我知道这是否回答了您的问题。

于 2017-07-26T12:21:14.313 回答