How to disable w3c in MS Edge webdriver options in selenium?

RJ RD 21 Reputation points
2020-12-01T14:34:31.99+00:00

How do I force w3c to false in edge options?
I see this option for chrome via setExperimentalOption("w3v", false) but not able to get this for edge.
Will the following suffice:
EdgeOptions edgeOptions = new EdgeOptions();
edgeOptions.setCapability("w3c", false);
webDriver = new EdgeDriver(edgeOptions);

Microsoft Edge | Microsoft Edge development
0 comments No comments
{count} votes

Accepted answer
  1. Anonymous
    2020-12-02T02:59:39.083+00:00

    @RJ RD ,

    From your code sample, it looks like you are using JAVA to automate the Edge chromium-browser using the Selenium web driver.

    I suggest you try to make a test with the code example below that may help you to disable w3c in Edge web driver.

    System.setProperty("webdriver.edge.driver", "Your_path_here\\msedgedriver.exe"); //modify path here...  
    EdgeOptions edgeOptions = new EdgeOptions();  
    DesiredCapabilities capabilities = new DesiredCapabilities();  
              
    capabilities.setCapability(EdgeOptions.CAPABILITY, edgeOptions);  
    capabilities.setCapability("w3c", false);  
    edgeOptions.merge(capabilities);         
      
    WebDriver driver = new EdgeDriver(edgeOptions);   
    driver.get("https://Your_site_address_here"); //Modify URL here...  
      
    System.out.println(capabilities.getCapability("w3c")); //Getting the value of w3c to verify it.  
    

    You can see that after setting the w3c capability to false, I try to check its value to verify whether it is false or not. On my side, I am getting the correct results.

    Please note that in my above test I am using msedgedriver_87.0.644.4 and selenium-java-4.0.0-alpha-7.

    ----------

    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Aydin VARDAR 1 Reputation point
    2021-05-25T14:57:35.25+00:00

    Hi @Anonymous ,

    I do as it says, but the code does not work because there is no "CAPABILITY" in "EdgeOptions". When I want to add "CAPABILITY" into "EdgeOptions.java", I cannot add it because it is "read only".

    How can we fix this problem?

    99545-image.png

    99544-image.png

    <code>99573-image.png</code>

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.