What are desired capabilities in Selenium

0 votes
What are desired capabilities in Selenium?
Jun 25, 2019 in Selenium by Varun
634 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, 2019 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,520 points
11,937 views
0 votes
1 answer

What are the types of Assertion in Selenium?

In selenium Assertion is nothing but a ...READ MORE

answered Feb 11, 2019 in Selenium by Fred
1,116 views
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, 2019 in Selenium by Priyaj
• 58,120 points
118 views
0 votes
2 answers

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,520 points
5,085 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,010 points
5,821 views
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,890 points
3,586 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,010 points
4,327 views
0 votes
1 answer
0 votes
1 answer