with protractor how to setup internet explorer configuration?

前端 未结 5 1624
执念已碎
执念已碎 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: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="] // 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.

提交回复
热议问题