Goto EDGE > setting and scroll down:
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
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