What are desired capabilities in Selenium

0 votes
What are desired capabilities in Selenium?
Jun 25, 2019 in Selenium by Varun
1,432 views

1 answer to this question.

0 votes

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, 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,500 points
17,446 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
2,232 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,020 points
668 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,500 points
13,690 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,190 points
9,151 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,910 points
7,230 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 3, 2020 in Selenium by Sri
• 3,190 points
7,881 views
0 votes
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP