How to define capabilities using ChromeOptions for RemoteWebDriver in Selenium?

0 votes

How to define capabilities using ChromeOptions for RemoteWebDriver in Selenium?

Jul 5 in Selenium by Celina
65 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 by Abha
• 22,870 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,350 points
165 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,090 points
1,962 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,090 points
548 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,130 points
882 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,130 points
546 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 in Selenium by Abha
• 22,870 points
52 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 in Selenium by Abha
• 22,870 points
44 views