Protractor test in IE

2019-02-15 02:56发布

I'm trying to just run the example test that is included in protractor on internet explorer and not getting very far :(

// An example configuration file.
exports.config = {
  directConnect: true,

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome'
  },

  // Framework to use. Jasmine is recommended.
  framework: 'jasmine',

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

  // Options to be passed to Jasmine.
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};

I've tried the obvious changing browser name to 'internet explorer' and 'version': 11 and I have commented out directConnect (as it was complaining about this)

The error I get is...

WebDriverError: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumH Q/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html

I have downloaded the latest IE driver and put it here...

C:\Users\darrenp\AppData\Roaming\npm\node_modules\protractor\selenium

and still no joy :(

can someone tell me if it is actually possible to run protractor tests in IE or am I just wasting my time?

I know you are going to ask why would I want to?? simple answer, I have to, my client uses IE and only IE and I need to be sure that my app is good in IE instead of chrome like what the rest of the world is using :)

1条回答
甜甜的少女心
2楼-- · 2019-02-15 03:33

1) Download IEDriverServer.exe 2) Place it in C:\Windows\System32

exports.config = {
  'autoStartStopServer': true,

  capabilities: {
    'browserName': 'internet explorer'
  },
  framework: 'jasmine',
  specs: ['example_spec.js'],
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};

3)Open Internet Explorer click options

4)In Security tab > Disable protected mode for all zones

5)Navigate to Privacy tab TurnOff PopUp Blocker

6)Navigate to Advanced tab

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

查看更多
登录 后发表回答