3

I tried all the solutions that are mentioned, but I am not able to get Microsoft Edge (HTML version 18) in Windows 10.

I downloaded the web driver using the below command on my personal PC and copied it to my work system under the node_modules\webdriver-manager\selenium.

DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0

On my personal system, I can run the script by using

capabilities: {
  'browserName': 'MircorsoftEdge' ,
},

But after copying the webdriver manually to my work system and trying to run the script, it's failing with the below error:

enter image description here

3

Goto EDGE > setting and scroll down:

enter image description here

Here note the edge html version , that is the version for which we have to download the driver for.

The below command (for downloading webdriver for edge html version 18) ,

ref: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0

downloads the web driver usually to system32 folder which is already in PATH variable. That's why your protractor scripts work fine in your local system.

To run it in the other system to which you copied the webdriver, follow any of the below approaches:

To start the selenium server manually:

Open cmd and run below command

 webdriver-manager start --edge "<path>"

eg:

 webdriver-manager start --edge "c:/New Folder/MicrosoftWebDriver.exe"

Now connect to the server using the protractor config file by pointing seleniumAddress to the correct address:

exports.config = {

specs: ['test.js'],

seleniumAddress:"http://localhost:4444/wd/hub",
capabilities: {
  'browserName': 'MicrosoftEdge' ,
 }

If selenium is started in port:4444

Starting selenium server from the script:

The driver for MicrosoftEdge can be started from the script in two ways

Method 1: by setting MicrosoftWebDriver.exe path in PATH variable

1) If your webdriver "MicrosoftWebDriver.exe" is in c:\New Folder, then add "c:\New Folder\" to Environmental variable PATH

enter image description here

Note: the driver name should be MicrosoftWebDriver.exe

Now you can run the script in edge as :

exports.config = {

specs: ['test.js'],

capabilities: {
  'browserName': 'MicrosoftEdge' ,
}

you don't have to mention seleniumAddress, the server starts automatically from the script.

Method 2: By, passing the driver location through jvmArgs

exports.config = {
specs: ['test.js'],


localSeleniumStandaloneOpts: {
    //port:5000, // you can even specify what port to start the server on 
    jvmArgs: ['-Dwebdriver.edge.driver=C:/New Folder/MicrosoftWebDriver.exe'],
},

capabilities: {
  'browserName': 'MicrosoftEdge' ,
}

Note: Don't pass quotest for jvmArgs eg: '-Dwebdriver.edge.driver="C:/New Folder/1.exe"' is wrong and '-Dwebdriver.edge.driver=C:/New Folder/MicrosoftWebDriver.exe' is right

| improve this answer | |
  • 1
    Added to PATH and it worked, Thanks a lot – Luke Mar 14 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.