Hey Varun, Desired Capabilities in Selenium are used to configure the driver instance of Selenium WebDriver by allowing to set properties like browserName, browserVersion, Platform etc. We can configure driver instance like FirefoxDriver, ChromeDriver, InternetExplorerDriver. The setCapability() method of the DesiredCapabilities is the most commonly used method and is used to set browser properties like browser type, platform type etc. For eg.
// Create DesiredCapabilities object
DesiredCapabilities capabilities = new DesiredCapabilities();
// Set deviceName
capabilities.setCapability("deviceName", "desired_device_name");
// Set BROWSER_NAME
capabilities.setCapability(CapabilityType.BROWSER_NAME, "IE");
// Set browser VERSION
capabilities.setCapability(CapabilityType.VERSION, "11.0");
// Set platformName
capabilities.setCapability("platformName", "WIN8_1");