Skip to content

.registerBasicAuth() not working in Edge browser #3848

Closed
@ChristophMuth

Description

Description of the bug/issue

When you create a new Nightwatch project and run a test in the Edge browser against a website that requires basic auth, it says that .registerBasicAuth() is only supported in Chromium based drivers.
As the Edge browser is Chromium based, I'd expect it to work the same way as when using Chrome.

Steps to reproduce

  1. Create a basic Nightwatch project with npm init nightwatch <directory-name>
  2. Write a basic test that navigates to a website protected with basic auth (see below)
  3. Download the Microsoft Edge WebDriver and add its location to the PATH
  4. Run the test
  5. See following error
Error
   The command .registerBasicAuth() is only supported in Chromium based drivers

Sample test

describe('basic auth test', function() {
  it('login via basic auth', function(browser) {
    browser
      .registerBasicAuth('username','password')
      .navigateTo('http://some-webpage-with-basic-auth')
      .waitForElementVisible('body')
      .assert.titleContains('some title')
      .end()
  });
});

Command to run

npx nightwatch --env edge test/sample.ts

Verbose Output

[basic auth test] Test Suite
────────────────────────────────────────────────────────
\ Starting EdgeDriver on port 9514...
[23072:26008:0731/195727.583:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.

| Starting EdgeDriver on port 9514...
[23072:26008:0731/195727.732:ERROR:edge_auth_errors.cc(487)] EDGE_IDENTITY: Get Default OS Account failed: Error: Primary Error: kImplicitSignInFailure, Secondary Error: kAccountProviderFetchError, Platform error: 0, Error string: 
i Connected to EdgeDriver on port 9514 (608ms).
  Using: msedge (115.0.1901.188) on WINDOWS.


  Running login via basic auth:
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  Error
   The command .registerBasicAuth() is only supported in Chromium based drivers
  √ Element <body> was visible after 38 milliseconds.
[23072:26008:0731/195730.338:ERROR:device_event_log_impl.cc(222)] [19:57:30.329] USB: usb_service_win.cc:415 Could not read device interface GUIDs: The system cannot find the specified file. (0x2)
  ✖ NightwatchAssertError

Nightwatch Configuration

module.exports = {
  src_folders: ['test','nightwatch'],
  page_objects_path: [],
  custom_commands_path: [],
  custom_assertions_path: [],
  plugins: [],
  globals_path: '',
  webdriver: {},
  test_workers: {
    enabled: true
  },
  test_settings: {
    default: {
      disable_error_log: false,
      launch_url: 'http://localhost',

      screenshots: {
        enabled: false,
        path: 'screens',
        on_failure: true
      },

      desiredCapabilities: {
        browserName: 'chrome'
      },
      
      webdriver: {
        start_process: true,
        server_path: ''
      },
    },
    
    edge: {
      desiredCapabilities: {
        browserName: 'MicrosoftEdge',
        'ms:edgeOptions': {
          w3c: true,
          args: []
        }
      },

      webdriver: {
        start_process: true,
        server_path: '',
        cli_args: [
        ]
      }
    },
  },
};

Nightwatch.js Version

3.1.2

Node Version

18.17.0

Browser

Edge 115.0.1901.188

Operating System

Windows 10

Additional Information

No response

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions