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
1,976 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
• 27,930 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 28, 2018 in Selenium by bug_seeker
• 15,400 points
515 views
+2 votes
1 answer
0 votes
1 answer
0 votes
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,510 points
3,955 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,510 points
3,096 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,890 points
2,346 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,890 points
2,493 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
• 27,930 points
602 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
• 27,930 points
332 views