Brown OP
Brown OP

Reputation: 43

microsoft edge and nightwatch

for some reason, I have not been able to get tests working in Microsoft Edge Windows 10.

Here's my nightwatch config

"edge": {
            "use_ssl": false,
            "silent": true,
            "output": true,
            "desiredCapabilities": {
                "browserName": "MicrosoftEdge",
                "platform": "Windows 10",
                "version": "13.10586",
                "screenResolution": "1280x1024",
                "avoidProxy": true
            }
}

Has anyone been able to get their tests working in Microsoft Edge? If so, what version of selenium do you use? I use 2.52 What version of the edge driver do you use?

Upvotes: 1

Views: 1804

Answers (3)

t_dom93
t_dom93

Reputation: 11496

The auto-generated nightwatch.conf.js already includes configuration for Edge browser, so you can just run by flagging the edge environment:

nightwatch --env edge

Upvotes: 0

combatc2
combatc2

Reputation: 1261

I had issues getting edge to work using Selenium 3.9.1 where Selenium was attempting to use the geckodriver to run tests against Edge.

My configuration looked as follows (snippet to keep to the point):

"selenium" : {
    "cli_args" : {
      "webdriver.chrome.driver" : "bin\\chromedriver.exe",
      "webdriver.edge.driver" : "bin\\MicrosoftWebDriver.exe",
      "webdriver.gecko.driver" : "bin\\geckodriver.exe",
      "webdriver.firefox.profile": ""
    }
},

"test_settings" : {
    "default" : {
      "desiredCapabilities": {
        "browserName": "edge",
        "marionette": true
        }   
    }
}

I was able to get around this by changing "edge" to "ie" and the browser name to "internet explorer" - see the updated configuration:

"selenium" : {
    "cli_args" : {
        "webdriver.chrome.driver" : "bin\\chromedriver.exe",
        "webdriver.ie.driver" : "bin\\MicrosoftWebDriver.exe",
        "webdriver.gecko.driver" : "bin\\geckodriver.exe",
        "webdriver.firefox.profile": ""
    }
},

"test_settings" : {
    "default" : {
        "launch_url" : "http://localhost",
        "selenium_port"  : 4444,
        "selenium_host"  : "localhost",
        "silent": true,
        "screenshots" : {
            "enabled" : false,
            "path" : ""
        },
        "desiredCapabilities": {
            "browserName": "internet explorer",
            "marionette": true
        }
    }
}

Upvotes: 1

nirmus
nirmus

Reputation: 5101

First of all you need Microsoft Edge Webdriver. You may download it from here: https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver/

Then in nigthwatch.js config you need to specify path to you edge webdriver (webdriver.edge.driver arg). This is how my config looks like: "selenium": { "start_process": true, "server_path": "./node_modules/file_dependencies/selenium-server-standalone.jar", "log_path": "", "host": "127.0.0.1", "port": seleniumPort, "cli_args": { "webdriver.chrome.driver": "./node_modules/file_dependencies/chromedriver.exe", "webdriver.ie.driver": "./node_modules/file_dependencies/IEDriverServer.exe", "webdriver.edge.driver": "C:/Program Files (x86)/Microsoft Web Driver/MicrosoftWebDriver.exe", "webdriver.gecko.driver": "./node_modules/file_dependencies/geckodriver.exe", "webdriver.firefox.profile": "" } }

Rest of your config looks fine

Upvotes: 1

Related Questions