Search code examples
testingautomationmicrosoft-edgeautomation-testingdesiredcapabilities

Disable the edge sidebar using Capabilities and EdgeOptions


All I want to know how I can disable edge sidebar using Edge capability. so i can use it in automation. I am aware about two different ways to it mentioned below.

  1. Using .send_keys Shift + Ctrl + /
  2. From registry Editor Open Registry Editor by typing regedit in the Run prompt and pressing the Enter key. Navigate to the following path: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Edge Right-click on the right section, and choose to create a DWORD with the name as HubsSidebarEnabled Set the value as 0x00000000 to disable it.

But i want to do it using Capabilities and EdgeOptions..

Attaching image of sidebar in edge

Please mention if any solution on this...

Edge version - Version 107.0.1418.62 (Official build) (64-bit) OS - win10


Solution

  • EdgeOptions, Capabilities

    Solution on C#

    var options = new EdgeOptions();
    options.AddArgument("--disable-features=msHubApps");
    

    Solution on Ruby

    DESIRED_CAPABILITIES = {    
        edge: { 
            browser_opts: {args:    %w( --disable-features=msHubApps),}
        }
    }
    
    Resource - https://github.com/MicrosoftEdge/EdgeWebDriver/issues/61