with protractor how to setup internet explorer configuration?

前端 未结 5 1623
执念已碎
执念已碎 2021-01-04 13:36

I am using protractor 1.3.1 and running iedriverserver.exe 2.43.0.0 with IE11 installed (windows). This is my spec:

describe(\'quick test IE driver\', functi         


        
相关标签:
5条回答
  • 2021-01-04 14:21

    Here is my config file:

    exports.config = {
    
    seleniumAddress: 'http://127.0.0.1:4444/wd/hub',
    capabilities: {
    'browserName': 'internet explorer',
     },
    
    framework: 'jasmine',
    
    // Spec patterns are relative to the current working directory when
    // protractor is called.
    specs: ['your_spec_file.js'],
    

    };

    The steps to run in IE :

    1. Need two terminals in Visual Studio Code, In the first terminal, Run command "webdriver-manager start" to start selenium server.
    2. In the second terminal, Run your js config file as : Protractor conffile_name.js

    This will successfully start Internet explorer. Thanks

    0 讨论(0)
  • 2021-01-04 14:25

    Update web manager for IE

    First step is to update the ie webdriver using webdriver manager.Open command prompt and run the command given below

    webdriver-manager update --ie
    

    Go to npm location In this step move to the NPM_LOCATION(folder where npm is installed at your system. Move to the following path "NPM_LOCATION\node_modules\protractor\selenium" At this location check that IEDriverServer.exe is present or not.

    Change for IE in conf.js

    // conf.js exports.config = {   seleniumAddress: 'http://localhost:4444/wd/hub',   specs: ['specs.js'],   capabilities: {
        'browserName': 'internet explorer' // conf for internet explorer     } }
    
    
    // spec.js describe('Protractor Demo App', function() {   it('should have a title', function() {
        browser.get('http://juliemr.github.io/protractor-demo/');
        expect(browser.getTitle()).toEqual('Super Calculator');   }); });
    

    Now run protractor conf.js

    Note: Make sure you restart server by -->webdriver-manager start

    taken from: http://protractorsupport.blogspot.com/2015/05/use-protractor-with-internet-explorer.html

    0 讨论(0)
  • 2021-01-04 14:25

    Download the IEDriverServer.exe Please specify the same in your config file

    seleniumArgs: ['-Dwebdriver.ie.driver=<path to IEDriverServer.exe>']
    
    0 讨论(0)
  • 2021-01-04 14:34

    I was looking around this question for few hours, the best way seems to be:

    1) download webdriver-manager --ie update

    This should download the driver from the google.. selenium ... release folder and place it directly in the good place in your npm local repository.

    2) setup in config.js file of your tests: ...

    multiCapabilities: [
        //{
        //    browserName: 'chrome',
        //    version: 'ANY'
        //},
        //{
        //    browserName: 'firefox',
        //    version: 'ANY'
        //},
        {
            browserName: 'internet explorer',
            version: 'ANY'
        },
    ],
    // For some IE functions you may need to specify defaultTimeoutInterval
    

    ... 3) setup IE:

    follow this post http://jimevansmusic.blogspot.fr/2012/08/youre-doing-it-wrong-protected-mode-and.html

    PS: about the "protected mode" setup of IE, it's important to have the same setup for all zones. I prefer to have protected mode 'on' for all zone

    4) patch the registry

    as described here: http://heliumhq.com/docs/internet_explorer

    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BFCACHE] "iexplore.exe"=dword:00000000

    5) IE 11 update break the way the system work:

    My lastest issue was "the server did not provide any stack trace ...." this is due to an update of the 17th of Dec 2014. Uninstall it and then it's good.

    https://code.google.com/p/selenium/issues/detail?id=3390

    crazy path to make it running. It cannot be like this for a long run, please comment my post with your experiences/feedbacks.

    Richard

    0 讨论(0)
  • 2021-01-04 14:37

    According to the protractor config doc, the config value "seleniumArgs" is deprecated.

    So, to have a single answer with all the info, here are the simplified steps:

    1. Install Protactor globally:

      npm install -g protractor
      
    2. Run webdriver-manager update --ie to update the Selenium drivers that Protactor uses. Be aware if you are running the global webdriver-manager or the local webdriver-manager (i.e ./node_modules./bin/webdriver-manager update help); they will unzip the drivers at separate locations; only the local will unzip in [Project dir]

    3. Take a look at the log of the previous command. It must show that the drivers were unzipped at a particular folder. Go to that folder and locate the IEDriverServer. In my case it was: "[Project dir]\node_modules\protractor\node_modules\webdriver-manager\selenium\IEDriverServer_x64_X.XX.X.exe. You will need to give the relative path to this file in the next step.

    4. Inside your conf.js file, add the following keys & values. Note the use of localSeleniumStandaloneOpts, which means you should remove the property seleniumAddress if you have it:

      multiCapabilities : [
        {
          'browserName' : 'chrome'
        }, {
          'browserName' : 'internet explorer'
        }
      ],
      
      localSeleniumStandaloneOpts : {
        jvmArgs : ["-Dwebdriver.ie.driver=<RELATIVE PATH TO IE DRIVER>"] // e.g: "node_modules/protractor/node_modules/webdriver-manager/selenium/IEDriverServer_x64_X.XX.X.exe"
      },
      

    That was all I needed to do. I don't start the server beforehand, I simply run protactor conf.js. Easier now, I guess.

    0 讨论(0)
提交回复
热议问题