Search code examples
javascriptselenium-webdriverselenium-edgedriver

WebDriverError: Unknown error, while opening second edge window using Selenium(Javsacript)


I am creating automation tool for Edge Browser using selenium, where I need to open three edge window with three different URLs parallelly. First Edge browser window launch successfully, but when calling function openEdgeBrowser for second url, it throws Exception: WebDriverError: Unknown error.

const webdriver = require('selenium-webdriver');
const edgedriver = require('edgedriver');
const edge = require('selenium-webdriver/edge');


var openEdgeBrowser = async function(url){

    try {
        let edgeService = await new edge.ServiceBuilder(edgedriver.path);
        let browser = await new webdriver.Builder().forBrowser('MicrosoftEdge').setEdgeService(edgeService).build();
        await browser.get(url);
        console.log('Browser launched successfully with url: ' + url);
    } catch(e) {
        console.log.end(`Error in launching edge browser, Exception: ${e}`);
    }
};

I expect to run three instances of Edge together.


Solution

  • The problem is that Edge does not support multiple instances:

    Hi, This is a known issue.

    I just checked the Feedback Hub and I only see a Microsoft internal posting for this issue. Will you add this to the Feedback Hub? Open the Feedback Hub app by using the Search Bar (Win + s) and typing “feedback hub”

    The only workaround I am aware of is to use Selenium grid with multiple Windows Clients. The Clients can be Hyper-V instances.

    Appreciate you reporting this issue and wish I had a better answer for you. :-/ Steve

    https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/17754737/

    The same has also been noted on twitter.

    https://twitter.com/instylevii/status/783480823445987329

    I can't find any indication that this bug has been fixed, so I'm going to assume it's still outstanding. It was definitely still outstanding in version 41.16299.15.0 and I can't find anything in the release notes mentioning a fix In version 42.