title: In Selenium Java client what is the difference between addArguments and setPreference methods?
body: <p>When using Java and Selenium, frequently when I google how to change a certain behaviour I find some example that explains how to change a setting using either addArgument or set_preferences, something like this:</p>
  <pre><code>    options.addArguments(&quot;dom.webdriver.enabled=False&quot;);
      options.addArguments(&quot;useAutomationExtension=False&quot;);
      
      profile.setPreference(&quot;dom.webdriver.enabled&quot;, False);
      profile.setPreference(&quot;useAutomationExtension&quot;, False);        
  </code></pre>
  <p>Looking at the Javadoc isn't very helful:</p>
  <p><a href="https://i.stack.imgur.com/y2KGM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/y2KGM.png" alt="addArguments Javadoc" /></a></p>
  <p><a href="https://i.stack.imgur.com/E9j85.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E9j85.png" alt="setPreference Javadoc" /></a></p>
  <p>Could someone explain the relation between these? Any conceptual differences? They seem very overlapping.</p>
  <p>Furthermore, there is <code>desiredCapabilities</code> and <code>capabilities</code> that also seems very similar. Why do these exist and how do they relate to each other?</p>