Can anyone demonstrate how desired capability methods can be used on a webdriver

0 votes
Can anyone demonstrate how desired capability methods can be used on a webdriver?
Jul 15, 2019 in Selenium by Rajesh
88 views

1 answer to this question.

0 votes

Hey Rajesh, you can check this code snippet to understand desired capabilities methods on a webdriver:

public class Desired_Capability_Methods {

  public static void main(String[] args) throws IOException {

  System.setProperty("webdriver.gecko.driver", "D:\\geckodriver.exe");
  WebDriver driver = new FirefoxDriver();
  driver.get("https://www.google.com/");

  // Created DesiredCapabilities object
  DesiredCapabilities capabilities = new DesiredCapabilities();

  capabilities.setCapability("deviceName", "your Device Name");
  capabilities.setCapability(CapabilityType.BROWSER_NAME, "Chrome");
  capabilities.setCapability(CapabilityType.VERSION, "5.1");
  capabilities.setCapability("platformName", "Android");
  }
}
answered Jul 15, 2019 by Abha
• 28,000 points

Related Questions In Selenium

0 votes
1 answer

Can anyone demonstrate how navigation commands can be used on a webpage in Selenium?

Hey Amanprit, Navigation Commands are used to ...READ MORE

answered Jul 4, 2019 in Selenium by Anvi
• 14,110 points
111 views
0 votes
1 answer

Can anyone explain how an AJAX call can be handled in Selenium webdriver?

Hello Megha, to demonstrate how AJAX calls are ...READ MORE

answered May 8, 2019 in Selenium by Pratibha
• 3,690 points
444 views
0 votes
1 answer
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
4,360 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,281 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,159 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
3,680 views
+1 vote
2 answers
0 votes
1 answer

How ID and Class can be used as a CSS Selector?

Hey Bruce, to identify a web element ...READ MORE

answered Jun 21, 2019 in Selenium by Abha
• 28,000 points
131 views