How to start server for Selenium grid Java Maven setup -
i setup selenium framework maven java. dependencies storing in pom.xml here got doubt.. how start server java -jar selenium-server-standalone-2.18.0.jar -role hub .. should place jar again in folder , should start path ? or shall go maven dependencies folder (.m2\repositories) ?
can 1 suggest me ?
if question not clear please ping back. explain in different way.
thanks raju
running selenium grid maven might not idea; depends on , how going do.
normally, run selenium tests in parallel against several/many different environments , has considerable resource cost. when start processes maven, run within main thread (as child threads), therefore having resources limited maven's configuration. depends on machine/s , configuration/s, starting grid maven , running few selenium tests in parallel (the hub , couple of nodes 5 instances each) on 1 average machine make maven hang lack of memory. avoid it, can adjust configuration, run tests sequentially (not in parallel, 1 node only), etc., again: depends on , how want , perhaps should consider other ways of running selenium tests.
nevertheless, if want try how selenium grid works or it's couple of specific tests running, can use maven-antrun-plugin
, start hub , nodes this:
<plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-antrun-plugin</artifactid> <version>1.7</version> <executions> <execution> <phase>pre-integration-test</phase> <!-- selenium tests should run in integration phase --> <configuration> <target> <java classname="org.openqa.grid.selenium.gridlauncher" classpathref="maven.test.classpath" failonerror="true" fork="false"> <arg line="-role hub"/> </java> <java classname="org.openqa.grid.selenium.gridlauncher" classpathref="maven.test.classpath" failonerror="true" fork="false"> <arg line="-role node -browser 'browsername=firefox,version=19.0,maxinstances=3' -browser 'browsername=internet explorer 64bits,version=9.0,maxinstances=2' -hub http://localhost:4444/grid/register -port 5555 -timeout 40000"/> </java> <java classname="org.openqa.grid.selenium.gridlauncher" classpathref="maven.test.classpath" failonerror="true" fork="false"> <arg line="-role node -browser 'browsername=chrome,version=24.0.1312.56,maxinstances=3' -browser 'browsername=internet explorer 64bits,version=9.0,maxinstances=2' -hub http://localhost:4444/grid/register -port 5556 -timeout 40000"/> </java> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin>
your should have dependency in pom.xml:
<dependency> <groupid>org.seleniumhq.selenium.server</groupid> <artifactid>selenium-server-standalone</artifactid> <version>2.30.0</version> <scope>test</scope> </dependency>
Comments
Post a Comment