Unable to define maxInstances when launching hub via Selenium 3.0.0 beta3 - selenium

I've been using the selenium-server-standalone-2.53.0.jar and recently tried to upgrade to version 3.0.0-beta3.
I'm attempting to spin-up a hub using the maxInstances parameter with the following command:
java -jar %~dp0DriverRepo\selenium-server-standalone-3.0.0-beta3.jar -role hub -port 5555 -maxInstances 9
This was working in 2.53.0, but in 3.0.0-beta3 I'm met with the following exception:
Exception in thread "main" com.beust.jcommander.ParameterException: Unknown option: -maxInstances
at com.beust.jcommander.JCommander.parseValues(JCommander.java:742)
at com.beust.jcommander.JCommander.parse(JCommander.java:282)
at com.beust.jcommander.JCommander.parse(JCommander.java:265)
at com.beust.jcommander.JCommander.<init>(JCommander.java:210)
at org.openqa.grid.selenium.GridLauncherV3$2.setConfiguration(GridLauncherV3.java:224)
at org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:138)
at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:67)
Apparently maxInstances is no longer a valid argument. I've searched for documentation regarding any changes that may have been made for use of the maxInstances parameter but I've had no luck. Has anyone else run into this issue, or is anyone aware of the proper way to spin-up a hub in 3.0.0-beta3 in a comparable way?

I don't remember ever using an argument called maxInstances. I think that earlier there was no validation for invalid command line arguments but with Selenium 3, they perhaps enabled it.
Here's an example of why I feel my theory is true
Selenium 2.53.1 output wherein I am providing an invalid argument named krishnan
selenium-server -role hub -krishnan 100
22:28:37.762 INFO - Launching Selenium Grid hub
2016-09-26 22:28:38.366:INFO::main: Logging initialized #758ms
22:28:38.378 INFO - Will listen on 4444
22:28:38.421 INFO - Will listen on 4444
2016-09-26 22:28:38.424:INFO:osjs.Server:main: jetty-9.2.z-SNAPSHOT
2016-09-26 22:28:38.452:INFO:osjsh.ContextHandler:main: Started o.s.j.s.ServletContextHandler#32eebfca{/,null,AVAILABLE}
2016-09-26 22:28:38.479:INFO:osjs.ServerConnector:main: Started ServerConnector#6ec8211c{HTTP/1.1}{0.0.0.0:4444}
And here's how Selenium 3 beta version behaves for the same command line.
java -jar selenium-server-standalone-3.0.0-beta2.jar -role hub -krishnan 100
Exception in thread "main" com.beust.jcommander.ParameterException: Unknown option: -krishnan
at com.beust.jcommander.JCommander.parseValues(JCommander.java:742)
at com.beust.jcommander.JCommander.parse(JCommander.java:282)
at com.beust.jcommander.JCommander.parse(JCommander.java:265)
at com.beust.jcommander.JCommander.<init>(JCommander.java:210)
at org.openqa.grid.selenium.GridLauncherV3$2.setConfiguration(GridLauncherV3.java:216)
at org.openqa.grid.selenium.GridLauncherV3.buildLauncher(GridLauncherV3.java:130)
at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:67)
Selenium has never had any argument named maxInstances. It only had something called maxSession`.
The only usage for maxInstances has been within a node configuration file as shown here which is passed to a Selenium node via the -nodeConfig argument. This represents the number of concurrent browser instances per browser flavor that can be opened up in a node.

Related

Why do we need org.openqa.grid.selenium.GridLauncherV3 in selenium grid

Is there any specific reason why we use GridlauncherV3, Currently doing a project where I use custom servlets for executing some task
For launching node:
java -Dwebdriver.chrome.driver=chromedriver -cp testservlet.jar:selenium-server-standalone.jar org.openqa.grid.selenium.GridLauncherV3 -role node -maxSession 10 -port 4444 -host localhost -hub http://localhost:4444/grid/register -browser browserName=chrome,version=103,platform=LINUX,maxInstances=10 -servlets testservlet.copies.DemoServlet,testservlet.copies.Demo2Servlet
Couldn't find any reason but if removed it throws an error, Were it needs a params
Unrecognized option: -role
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Thanks in advance.
As you are using are using java -cp, it is a requirement to specify the class that contains the main() method.
In the case of creating a jvm to run as selenium grid, you require the class that contains the main() method, in this case that is org.openqa.grid.selenium.GridLauncherV3.
This method is used to initiate the grid with all the required configuration in your cli command.
See the method here: GridLauncherV3

Failed to start new browser session: org.openqa.selenium.server.RemoteCommandException: Error while launching browser on session null

09:39:51.984 INFO - Got result: Failed to start new browser session: org.openqa.selenium.server.RemoteCommandException: Error while launching browser on session null
09:39:52.002 INFO - Command request: getNewBrowserSession[*firefox, http://website.localhost] on session null
09:39:52.002 INFO - creating new remote session
09:39:52.003 INFO - Allocated session 4b3951d894ed4a2c94b7fd9758cd5554 for http://website.localhost, launching...
jar:file:/usr/bin/selenium-server-standalone-2.41.0.jar!/customProfileDirCUSTFFCHROME
09:39:52.071 INFO - Preparing Firefox profile...
09:40:12.129 ERROR - Failed to start new browser session, shutdown browser and clear all session data
java.lang.RuntimeException: Timed out waiting for profile to be created!
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.waitForFullProfileToBeCreated(FirefoxChromeLauncher.java:307)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.populateCustomProfileDirectory(FirefoxChromeLauncher.java:119)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:89)
at org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchRemoteSession(FirefoxChromeLauncher.java:346)
at org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchRemoteSession(FirefoxLauncher.java:114)
at org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:400)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:144)
at org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:105)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:809)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:435)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:405)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:151)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
09:40:12.131 INFO - Got result: Failed to start new browser session: org.openqa.selenium.server.RemoteCommandException: Error while launching browser on session null
09:40:12.143 INFO - Command request: getNewBrowserSession[*firefox, http://website.localhost] on session null
what i am doing ?
Step 1: Start the hub
The Hub is the central point that will receive all the test request and distribute them the the right nodes.
Open a command prompt and navigate to the directory where you copied the selenium-server-standalone file. Type the following command:
java -jar selenium-server-standalone-2.14.0.jar -role hub
Step 2: Start the nodes
Regardless on whether you want to run a grid with new WebDriver functionality, or a grid with Selenium 1 RC functionality, or both at the same time, you use the same selenium-server-standalone jar file to start the nodes.
java -jar selenium-server-standalone-2.14.0.jar -role node -hub http://localhost:44444/grid/register (here 44444 is for the environment i am working)
This is due to compatibility issues between selenium and firefox.
You need to upgrade to the latest selenium server, 2.44 at the moment.
Yes! As alec[xe suggested this is due to the compatibility issues between firefox and selenium. For firefox version higher than 30 you must use selenium 2.44 version.Here's the changelog of the selenium please take a look and decide which version of the selenium will fulfill your requirement.
Click here to download the latest(2.44) version of the selenium.

Selenium Grid 2 from mac hub to windows node

I am setting up selenium grid to be able to test IE in a Virtual Machine. I am running into:
geb.driver.DriverCreationException: failed to create driver from callback
which generally means the driver is not being found. I'm pointing it to the correct location, however something isn't working. FYI refers to my hub machine's intranet IP address.
Here are my files/commands:
From Mac hub terminal:
java -jar selenium-server-standalone-2.39.0.jar -role hub
From Windows node terminal:
C:\selenium-server>java -jar selenium-server-standalone-2.39.0.jar -role node -hub http://:4444/grid/register -browser browserName="internet explorer",version=10.0,platform=WINDOWS -Dwebdriver.ie.driver=C:\IEDriverServer.exe
My GebConfig.groovy file where the drivers are instantiated:
ie {
driver = {
DesiredCapabilities capabilities = new DesiredCapabilities().internetExplorer().
new RemoteWebDriver(new URI("http://<IP>:4444/wd/hub"), capabilities)
}
}
My stack trace is as follows:
geb.driver.DriverCreationException: failed to create driver from callback 'script13923985022291935133551$_run_closure2_closure5_closure9#557c6200'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)
at geb.Configuration.createDriver(Configuration.groovy:354)
at geb.Configuration.getDriver(Configuration.groovy:343)
at geb.Browser.getDriver(Browser.groovy:105)
at geb.Browser.go(Browser.groovy:394)
at geb.Page.to(Page.groovy:184)
at geb.Browser.via(Browser.groovy:475)
at geb.Browser.to(Browser.groovy:434)
at geb.Browser.to(Browser.groovy:412)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:51)
at com.bloomhealthco.functional.LoginTestSpec.User is able to login as an administrator(LoginTestSpec.groovy:12)
Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.openqa.selenium.remote.RemoteWebDriver(java.net.URI, groovy.util.ConfigObject)
at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy:44)
at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy)
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
... 14 more
geb.driver.DriverCreationException: failed to create driver from callback 'script13923985022291935133551$_run_closure2_closure5_closure9#557c6200'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)
at geb.Configuration.createDriver(Configuration.groovy:354)
at geb.Configuration.getDriver(Configuration.groovy:343)
at geb.Browser.getDriver(Browser.groovy:105)
at geb.report.PageSourceReporter.getPageSource(PageSourceReporter.groovy:42)
at geb.report.PageSourceReporter.writePageSource(PageSourceReporter.groovy:38)
at geb.report.PageSourceReporter.writeReport(PageSourceReporter.groovy:29)
at geb.report.CompositeReporter.writeReport(CompositeReporter.groovy:31)
at geb.Browser.report(Browser.groovy:775)
at geb.spock.GebReportingSpec.report(GebReportingSpec.groovy:44)
at geb.spock.GebReportingSpec.cleanup(GebReportingSpec.groovy:39)
Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.openqa.selenium.remote.RemoteWebDriver(java.net.URI, groovy.util.ConfigObject)
at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy:44)
at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy)
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
... 14 more
geb.driver.DriverCreationException: failed to create driver from callback 'script13923985022291935133551$_run_closure2_closure5_closure9#557c6200'
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:35)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy:80)
at geb.driver.CachingDriverFactory.getDriver_closure3(CachingDriverFactory.groovy)
at geb.driver.CachingDriverFactory$SimpleCache.get(CachingDriverFactory.groovy:30)
at geb.driver.CachingDriverFactory.getDriver(CachingDriverFactory.groovy:79)
at geb.Configuration.createDriver(Configuration.groovy:354)
at geb.Configuration.getDriver(Configuration.groovy:343)
at geb.Browser.getDriver(Browser.groovy:105)
at geb.Browser.clearCookies(Browser.groovy:483)
at geb.Browser.clearCookiesQuietly(Browser.groovy:491)
at geb.spock.GebSpec.resetBrowser(GebSpec.groovy:45)
at geb.spock.GebSpec.cleanup(GebSpec.groovy:67)
Caused by: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.openqa.selenium.remote.RemoteWebDriver(java.net.URI, groovy.util.ConfigObject)
at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy:44)
at script13923985022291935133551.run_closure2_closure5_closure9(script13923985022291935133551.groovy)
at geb.driver.CallbackDriverFactory.getDriver(CallbackDriverFactory.groovy:29)
... 11 more
Additionally the node can be registered with the hub:
ip:4444/grid/console screenshot
I've been searching all day and it seems this should work. Does anyone have any suggestions or know what's wrong?
Thank you in advanced.
From your stacktrace I can see that the real reason for not being able to create the driver is:
Could not find matching constructor for: org.openqa.selenium.remote.RemoteWebDriver(java.net.URI, groovy.util.ConfigObject)
Is the snipped of your GebConfig.groovy exactly the same as you have it in your file? I see that capabilities is defined as an instance of DesiredCapabilities in your snippet so I don't understand why would a config object be passed as the second parameter... I can't see it but maybe you have a typo somewhere? With Groovy config scripts you'll have issues if you mistype something as you will get a new empty ConfigObject instance instead of an error.
The second thing is that the first parameter should be an URL and not a URI if you're after using this constructor.

Selenium Grid: MaxSessions vs MaxInstances

I was wondering if anybody could shed some light on a Selenium question that has been giving us a bit of head scratching.
We're confused on meaning of MaxSession and MaxInstances of Selenium Grid. We think that the MaxSession is the total number of test sessions that can run on a single node. And we also think that the MaxInstances is the total number of browsers that a test can open.
Or is MaxInstances the total number of browsers available to the node?
The command that we are using is:
java -Xrs -jar selenium-server.jar -role node -port 44506 -hub http://localhost:44500
/grid/register -firefoxProfileTemplate SeleniumProfile -timeout 300000 -browser
"browserName=firefox,maxInstances=10,platform=ANY,seleniumProtocol=WebDriver" -browser
"browserName=chrome,maxInstances=10,platform=ANY,seleniumProtocol=WebDriver"
We think the way we are using our node (above) is 5 concurrent test sessions by default.
Does each test have 20 browsers available to it?
Or does each test session share the 20 browsers (10 chrome/10 FF) in a pool - with the other test sessions?
Nice question....i would say it's bit confusing.... But will try to answer it in simple terms..
MaxInstances This says....how many instances of same version of browser can run over the Remote System.
For example, i have a FF12,IE and i declared the command as follows
-browser browserName=firefox,version=12,maxInstances=5,platform=LINUX
-browser browserName=InternetExplorer,version=9.0,maxInstances=5,platform=LINUX
So i can run 5 instances of Firefox 12 and as well as 5 instances of IE9 at the same time in remote machine. So total user can run 10 instances of different browsers (FF12 & IE9) in parallel.
MaxSession This says....how many browsers (Any Browser and any version) can run in parallel at a time in the remote system. So this overrides the Max Instances settings and can restrict the number of browser instances that can run in parallel.
For above example, when maxSession=1 forces that you never have more than 1 browser running.
With maxSession=2 you can have 2 Firefox tests at the same time, or 1 Internet Explorer and 1 Firefox test).
Irrespective of what MaxInstances you have defined.
For more clear info do visit - https://seleniumhq.github.io/docs/grid.html
To expand upon Anuragh27crony's answer, I've drawn up a quick diagram:
If this is your node config, then you can execute at most 5 tests in parallel, for example in the following combinations:
3 * chrome, 2 * firefox
2 * chrome, 2 * firefox, 1 * edge
5 * edge
3 * chrome
The following combinations are NOT possible:
4 * chrome (exceeds Chrome maxInstances)
6 * edge (exceeds maxSessions)
3 * chrome, 3 * firefox (exceeds maxSessions)
As mentioned by Anuragh, MaxInstances applies to a specific browser, while MaxSessions applies to the entire node.
As per the documentation in Configuring the nodes by default, starting a Selenium Grid Node allows for concurrent usage of 11 browsers:
5 Firefox
5 Chrome
1 Internet Explorer
The maximum number of concurrent tests is set to 5 by default. To change this and other browser settings, you can pass in parameters to each -browser switch (each switch represents a node based on your parameters). If you use the -browser parameter, the default browsers will be ignored and only what you specify command line will be used.
maxInstances
maxInstances is an optional parameter which can be passed through the -browser optional parameter.
Usecase 1
To configure a Selenium Grid Node for 20 instances of Firefox version=X.Y.Z you can use the following solution:
Command:
java -Dwebdriver.gecko.driver=geckodriver.exe -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.1.125:4444/grid/register -browser browserName=firefox,version=X.Y.Z,maxInstances=20,platform=WINDOWS
Node Console Logs:
C:\Utility\SeleniumGrid>java -Dwebdriver.gecko.driver=geckodriver.exe -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.1.125:4444/grid/register -browser browserName=firefox,version=X.Y.Z,maxInstances=20,platform=WINDOWS
16:54:11.843 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.59, revision: e82be7d358
16:54:12.003 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Launching a Selenium Grid node on port 6318
2020-02-14 16:54:12.523:INFO::main: Logging initialized #1022ms to org.seleniumhq.jetty9.util.log.StdErrLog
16:54:12.860 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
16:54:12.974 INFO [SeleniumServer.boot] - Selenium Server is up and running on port 6318
16:54:12.974 INFO [GridLauncherV3.lambda$buildLaunchers$7] - Selenium Grid nodeis up and ready to register to the hub
16:54:13.161 INFO [SelfRegisteringRemote$1.run] - Starting auto registration thread. Will try to register every 5000 ms.
16:54:13.765 INFO [SelfRegisteringRemote.registerToHub] - Registering the node to the hub: http://192.168.1.125:4444/grid/register
16:54:13.962 INFO [SelfRegisteringRemote.registerToHub] - The node is registered to the hub and ready to use
Grid Console Snapshot:
Usecase 2
To configure a Selenium Grid Node for 10 instances of Firefox version=A.B.C and 20 instances of Chrome version=X.Y.Z you can use the following solution:
Command:
java -Dwebdriver.gecko.driver=geckodriver.exe -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.1.125:4444/grid/register -browser browserName=firefox,version=X.Y.Z,maxInstances=10,platform=WINDOWS -browser browserName=chrome,version=X.Y.Z,maxInstances=20,platform=WINDOWS
Grid Console Snapshot:
-maxSession
-maxSession is also an optional parameter which can be passed as a main parameter to configure the maximum number of browsing contexts that can run in parallel on a particular node. This is different from the maxInstance of supported browsers (Example: For a node that supporting Firefox version A.B.C, Firefox version P.Q.R and Chrome version X.Y.Z, maxSession=1 will ensure that you never have more than 1 browser running. With maxSession=2 you can have 2 Firefox tests executing at the same time, or 1 Firefox and 1 Chrome test).
Example:
java -Dwebdriver.gecko.driver=geckodriver.exe -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.1.125:4444/grid/register -browser "browserName=firefox,version=A.B.C,maxInstances=10,platform=WINDOWS" -browser "browserName=firefox,version=P.Q.R,maxInstances=10,platform=WINDOWS" -browser "browserName=chrome,version=X.Y.Z,maxInstances=20,platform=WINDOWS" -maxSession 2
Grid Console Snapshot:
MaxInstances: this gives you more slots per node, For example, MaxInstances=5 will allow a maximum of 5 browsers per node
MaxSession: sets the maximum amount of tests that can run at the same time in a node.
if MaxInstances=5, then MaxSession should also be at least 5.
see more at https://github.com/SeleniumHQ/docker-selenium

Selenium grid newbie questions

Ok, I have already several testcases written for Webdriver approach. But now I need get the Selenium Grid for possible stress testing of the webapp.
I found this demo but its unable to control the Firefox 11. Then I found out this wiki page which is two level higher than I can understand, but that JAR File is supposedly able to control the Firefox 11.
What I need - some resources how to get the Grid started and how to let it do simple test - like writing "Hello World" into Google search bar and then clicking "Search."
EDIT
This is the error when I am trying to run the grid as node
D:\_dev\selenium-grid-1.0.8\lib>java -jar selenium-server-standalone-2.20.0.jar -role node -hub http://localhost:4444/grid/register
22-Mar-2012 10:33:48 org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid node
Exception in thread "main" java.lang.NoSuchMethodError: java.lang.String.isEmpty()Z
at org.openqa.grid.common.RegistrationRequest.getRemoteControlConfiguration(RegistrationRequest.java:585)
at org.openqa.grid.internal.utils.SelfRegisteringRemote.startRemoteServer(SelfRegisteringRemote.java:86)
at org.openqa.grid.selenium.GridLauncher.main(GridLauncher.java:72)
And this is output from server which seems ok
D:\_dev\selenium-grid-1.0.8\lib>java -jar selenium-server-standalone-2.20.0.jar -role hub
22-Mar-2012 10:33:33 org.openqa.grid.selenium.GridLauncher main
INFO: Launching a selenium grid server
360 [main] INFO org.seleniumhq.jetty7.server.Server - jetty-7.x.y-SNAPSHOT
422 [main] INFO org.seleniumhq.jetty7.server.handler.ContextHandler - started o.s.j.s.ServletContextHandler{/,null}
438 [main] INFO org.seleniumhq.jetty7.server.AbstractConnector - Started SocketConnector#0.0.0.0:4444
If you are working with windows, you need to add the path to firefox to your PATH environment variable. The reason for this is, that windows then knows what program to start, when you call firefox from command line, for example.
Then you need to donwload the selenium server standalone and then start the hub
java -jar selenium-server-standalone-2.20.0.jar -role hub
and also the client:
java -jar selenium-server-standalone-2.20.0.jar -role node -hub http://localhost:4444/grid/register
Now you need to create a new Java Project in Eclipse, for example like so:
class MyFristTest{
//using the #test annotation tells eclipse
//to use junit (or tells you to import it)
#Test
public void myTest(){
Selenium selenium = new DefaultSelenium(“localhost”, 4444, “*firefox”, “http://www.google.com”);
DesiredCapabilities capability = DesiredCapabilities.firefox();
WebDriver driver = new RemoteWebDriver(new URL("http://localhost:4444/wd/hub"), capability);
driver.get("http://www.example.com");
driver.findElement(By.linkText("RFC 2606")).click();
driver.findElement(By.linkText("txt")).click();
}
If you now start the JUnit Test, it should magically work.