2

I am using Maven as a build tool. On selniumhq site I can see selenium-server-standalone.jar file but I could not found related Maven dependency. Is there any maven dependency for selenium standalone file? latest selenium standalone file is : selenium-server-standalone-3.2.0.jar

Note : I want to execute code on Remote desktop machine using Selenium grid (which require aforementioned jar file)

SachinB
  • 348
  • 6
  • 18
  • Why would you even need a selenium standalone when you go for maven? Just Use [Selenium-Java](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java/3.2.0) – Madhan Mar 09 '17 at 12:50
  • I want to implement Selenium grid for executing code on remote desktop. I have edited my problem statement accordingly. Thanks – SachinB Mar 09 '17 at 12:57
  • If that's the case you can use [Selenium Server](https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-server/3.2.0) – Madhan Mar 09 '17 at 14:05
  • Hi Madhan, Thanks for response. When I was checking on google about how to use selenium grid, everywhere it is mention that one need to use/download selenium-standalone-server jar file. so little confused. – SachinB Mar 09 '17 at 18:05

1 Answers1

3

I think you should refer to this manual first: http://www.seleniumhq.org/docs/07_selenium_grid.jsp#starting-selenium-grid

i.e. in order to use grid you need you need to create grid instance first by running commands from command line, then you need to register node, again by using command line, and after that from your code you need to create instance of RemoteWebDriver (refer to this page for more details: http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#remotewebdriver).

If, for some reason, you want to to create grid\register nodes from your project maybe it makes sense to download it to your resources folder, execute it from there using Runtime (refer to this link for more details: http://docs.oracle.com/javase/7/docs/api/java/lang/Runtime.html) and then connect to it. But I would strongly recommend avoiding doing so.

Mikhail
  • 665
  • 4
  • 16
  • Thanks Mikhail For response. But before doing any of things that you have mentioned above, I will need selenium-standalone-server dependency. I am not able to find latest dependency on maven/google and that is why I want to know how can I add mentioned dependency in Maven – SachinB Mar 09 '17 at 17:59
  • 1
    That is exactly what I was saying, you don't need to have this dependency in your project you should just download it as jar from http://www.seleniumhq.org/download/ and then either put it into your resources folder and manipulate it through Runtime, either put it somewhere else and manipulate it via command line. – Mikhail Mar 09 '17 at 18:29
  • 2
    Adding to what @Mikhail said.. You use the standalone jar when you want to start a grid/node (You do this by downloading the uber jar directly and starting it via command line). You need the selenium server dependency ONLY IF you are planning to spawn a Grid/Node via your code. The Grid/Node is a separate JVM by itself (remember you spawn it separately) – Krishnan Mahadevan Mar 10 '17 at 03:26
  • Thanks very much Mikhail, Krishnan Mahadevan. I think you guys have already answered my question – SachinB Mar 10 '17 at 04:46