Grid Setup | Selenium Forum
M
Posted on 17/11/2015
Hi Ashish / All,


My test case runS well in all browser locally.. Now I am planning to put them in Grid.

I have few clarification, could you kindly clarify

1) Do I have to update my in code for all Browser to Remote Browser ?

2) How to SET Or Provide the path for IE or Chrome Driver

3) Also I was wondering, upon invoking the Remote IP and Port does the URL will launch or it prompt the users to accept the incoming connection...

(Something like VNC).... Since we are running on remote, any privilages issues ?

Any pointers is useful.

Thanks


Regards

J

M
Replied on 19/11/2015

[quote:1p7w4xqk]Do I have to update my in code for all Browser to Remote Browser ?
[/quote:1p7w4xqk]
use this code.
[code:1p7w4xqk]URL server = new URL("http://127.0.0.1:4444/wd/hub");

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setBrowserName("firefox");

System.out.println("Connecting to " + server);

WebDriver driver = new RemoteWebDriver(server, capabilities);

driver.get("http://www.google.com");

driver.quit();
}
[/code:1p7w4xqk]





[quote:1p7w4xqk]2) How to SET Or Provide the path for IE or Chrome Driver[/quote:1p7w4xqk]

Actually the error message is slightly wrong. You don't have to set the system property, but the chromedriver executable needs to be available in the PATH on the remote machine (where the server is running).

If you want to specify the path as a property, you can do that when you launch the server, e.g.:

[code:1p7w4xqk]java -Dwebdriver.chrome.driver=/path/to/driver -jar selenium-server-standalone.jar
[/code:1p7w4xqk]

[code:1p7w4xqk]DesiredCapabilities capability = DesiredCapabilities.chrome();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
[/code:1p7w4xqk]







[quote:1p7w4xqk]3) Also I was wondering, upon invoking the Remote IP and Port does the URL will launch or it prompt the users to accept the incoming connection...

(Something like VNC).... Since we are running on remote, any privilages issues ?
[/quote:1p7w4xqk]

there can be some privilege issues.


M
Replied on 22/11/2015

Thanks,

Ashish, Could you please send me that .txt file, which are referring you in module for reference.

Thanks

Regards
J


M
Replied on 22/11/2015

Hi Ashish,

One thing i don't understand is, do i have to copy my source code to the remote machine entire ?

And set up the hub and node in the remote machine and run this ?

Thanks


Regards
J


M
Replied on 22/11/2015

Also I have Firefox profiler and Chrome Profile.. How can I have capabilities set along with Profiler ...

Kindly clarify.


Thanks

Regards
J


M
Replied on 23/11/2015

[quote="jabbarali.mirza@gmail.com":1z0pe4qd]Also I have Firefox profiler and Chrome Profile.. How can I have capabilities set along with Profiler ...
[/quote:1z0pe4qd]

File profileDirectory = new File("c://mach//lib//prof");
FirefoxProfile profile = new FirefoxProfile(profileDirectory);

DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capabilities);


M
Replied on 23/11/2015

[quote="jabbarali.mirza@gmail.com":n4h8599w]Thanks,

Ashish, Could you please send me that .txt file, which are referring you in module for reference.

Thanks

Regards
J[/quote:n4h8599w]

txt file is in selenium_pack.zip


M
Replied on 23/11/2015

[quote="jabbarali.mirza@gmail.com":2nro0kp8]Hi Ashish,

One thing i don't understand is, do i have to copy my source code to the remote machine entire ?

And set up the hub and node in the remote machine and run this ?

Thanks


Regards
J[/quote:2nro0kp8]

no need to copy source code to remote machine.

you just have to start nodes on remote machines.


M
Replied on 23/11/2015

Thanks Ashish,


When you say "start nodes on the remote machines", Only Nodes right ? No Hub needed to be register in the Remote Machine ?

and my understanding standing the hub is like this (After download/copying the jars and exe in the remote machine)

java -jar -Dwebdriver.ie.driver=c:\IEDriverServer.exe selenium-server-standalone-2.48.2.jar -role webdriver -hub http://localhost:4444/grid/register -port 5557 -browser browserName=iexplore maxInstances=1 -maxSession 1

localhost- Will be my hub ip and the port will be my port where IE Node is listening

and I have to issue this command in the machine right ? Pls clarify


Regards
J


M
Replied on 23/11/2015

yes only nodes needs to be started at the remote machine.

please watch the Grid module for more info.