How to define capabilities using ChromeOptions for RemoteWebDriver in Selenium

0 votes

How to define capabilities using ChromeOptions for RemoteWebDriver in Selenium?

Jul 5, 2019 in Selenium by Celina
5,452 views

1 answer to this question.

0 votes

Hi Celina, to define capabilities for RemoteWebdriver, you need to create an instance of ChromeOptions, then we can use 'setCapability()' method for setting ChromeDriver-specific capabilities and pass ChromeOptions object into the RemoteWebDriver constructor. Following code snippet defines the ChromeDriver-specific capabilities for RemoteWebdriver using setCapability method:

ChromeOptions options = new ChromeOptions();

options.setCapability(CapabilityType.PLATFORM_NAME, Platform.WINDOWS);

options.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR, UnexpectedAlertBehaviour.ACCEPT);

options.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); 

driver = new RemoteWebDriver(new URL("http://10.x.x.x:4444/wd/hub"), options);

driver.manage().window().maximize();
answered Jul 5, 2019 by Abha
• 28,140 points

Related Questions In Selenium

0 votes
1 answer

How to wait for the webpage to load in selenium using java

Firstly, when you launch a web application, ...READ MORE

answered Aug 29, 2018 in Selenium by bug_seeker
• 15,520 points
1,907 views
+2 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

How to handle drop downs using Selenium WebDriver in Java

First, find an XPath which will return ...READ MORE

answered Mar 27, 2018 in Selenium by nsv999
• 5,500 points
8,303 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,567 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,084 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,178 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,840 views
0 votes
1 answer

How to import TestNG in Eclipse for Selenium?

Hi Charu, to install TestNG framework in ...READ MORE

answered May 17, 2019 in Selenium by Abha
• 28,140 points
2,998 views
0 votes
1 answer

How to run test scripts in Selenium using PhantomJS?

Hey @Shushil, you can run your test ...READ MORE

answered May 17, 2019 in Selenium by Abha
• 28,140 points
1,721 views
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