Desired capabilities
In Distributed testing using Selenium Grid, the test sends a request to the hub to create a session or test slot on the node. Desired capabilities allow you to define the browser configuration and the remote WebDriver instance. This can include browser-specific settings, platform information, and other configurations necessary to control the browser.
Some important desired capabilities are as follows:
Browser Name: Specify the browser in which tests will be executed.
Browser Version: Specify the browser version.
Platform: Specify the operating system where the tests will run.
Browser-Specific Options
Example
When running tests on Selenium Grid, you need to specify the desired capabilities for the browser and the platform on which the tests should run.
capabilities = DesiredCapabilities.CHROME.copy()
capabilities['browserName'] = 'chrome'
self.driver = webdriver.Remote(command_executor=remote_url,
desired_capabilities=capabilities)<br />
Desired capabilities are set as key-value( KV ) pairs. For example, To route the test to the Chrome node, you can set it to:
desired_capabilities = {
          “browserName”:”chrome” }
To route the test to the Firefox node, you can set it to:
desired_capabilities = {
             “browserName”:”firefox” }