0

I'm creating a base for automated testing of a browser extension, using typescript, selenium-webdriver (https://www.npmjs.com/package/selenium-webdriver latest version) and windows 10.

The problem is that I can not load the extension to Edge (version 44.17763.1.0)

The current test scenario is:

1) Open browser with the loaded extension
2) Go to the test page
3) Check if the elements added by the extension are present

The issue that I am facing is that Edge does not load the extension, the browser opens, proceeds to the page and fails since the elements are missing.

Here is the code for creating Edge:

    function buildEdgeDriver(): WebDriver {
    const service = new edge.ServiceBuilder().setPort(edgeWebdriverPort);
    const extensionPaths = [edgeExtensionPath];
    const cap = new Capabilities({extensionPaths});
    const options = new edge.Options();
    if (useBrowserExtension) {
        cap.set('extensionPaths', extensionPaths);
    }

    return new Builder()
        .withCapabilities(cap)
        .forBrowser(Browser.EDGE)
        .setEdgeOptions(options)
        .setEdgeService(service).build();
    }

According to the documentation, this should be fine: https://docs.microsoft.com/en-us/microsoft-edge/extensions/guides/packaging/creating-and-testing-extension-packages#automated-testing-with-webdriver

I also found a similar problem which was solved, but the solution did not help me: https://stackoverflow.com/questions/53073851/edge-webdriver-17134-extension-are-not-loaded

The extension is in unpacked and signed, placed in the appropriate folder:

C:\Users\PORTER\AppData\Local\Packages\Microsoft.MicrosoftEdge_8wekyb3d8bbwe\LocalState\extension\

I already tried providing both packed and unpacked versions of the extension and pointing the extensionPaths to all subfolders of the unpacked extension.

Adding the extension manually to the main edge profile did not add it to the edge started by selenium. Edge always starts but always without the extension.

There are no logs indicating that there was an issue with extension loading (there are no logs at all besides the assertion error).

Any help would be much appreciated :)

1 Answer 1

0

After some more searching I found this issue:

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

It seems that the issue is not in my code but somewhere on the line of Edge/Selenium/Windows 10 version 1809 (as others have had similar experience). For the time of writing this, the ticket is still active and reassigned to a new support person. If anyone is interested in the answer to my above question I would suggest checking the link for possible future solutions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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