What are desired capabilities in Selenium?

0 votes
What are desired capabilities in Selenium?
Jun 25 in Selenium by Varun
23 views

1 answer to this question.

0 votes

Hey Varun, Desired Capabilities 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, InternetExplorerDriverThe 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");
answered Jun 25 by Deepak

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

What are the differences between getText() and getAttribute() functions in Selenium WebDriver?

See, both are used to retrieve something ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,050 points
4,317 views
0 votes
1 answer
0 votes
1 answer

What are the major exceptions that occur in Selenium?

There are mostly 5 different types of ...READ MORE

answered Feb 13 in Selenium by Priyaj
• 56,160 points
25 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
260 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
629 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
257 views
0 votes
1 answer
0 votes
1 answer