SetUp for ChromeDriver

Start Selenium Server:

C:\Users\ashish.sharda\Downloads>java -jar selenium-server-standalone-2.42.1.jar -role hub -port 4445 -Dwebdriver.chrome.driver=C:\Users\ashish.sharda\Downloads \chromedriver.exe

 

On the client side :

Go to the directory where you have chromedriver installed.

Try to put selenium server jar in the same place

Then

(1)SET PATH=%PATH%;.

(2)C:\Users\ashish.sharda\Downloads>java -jar selenium-server-standalone-2.42.1.jar -role node -hub http://localhost:4445/grid/register

 

Then in the code :

ChromeOptions options = new ChromeOptions();

    options.addArguments(“test-type”);

   

 

//System.setProperty(“webdriver.chrome.driver”, prop.getProperty(“chromeLocation”));

DesiredCapabilities capability = DesiredCapabilities.chrome();

capability.setCapability(“chrome.binary”,“C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe”);

capability.setCapability(ChromeOptions.CAPABILITY, options);

driver = new RemoteWebDriver(new URL(http://172.16.192.107:4445/wd/hub”), capability);//    ChromeOptions options = new ChromeOptions();

driver.get(prop.getProperty(“produrl”));

driver.manage().window().maximize();

Advertisements

About qainterviews

Software Geek,QA Expert,Blogger
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s