0

I have problem with maven. I start using Maven TestNG in the grid . I have set thread-count at 10 in the xml file and Maven runs tests 14 times. I do not understand why this is so. Below paste configuration.

http://pastebin.com/JYLL5ZJt

Below my files tree:

http://pastebin.com/aVFFaNng

I'm using xvfb browser to tests. I start hube this way :

java -jar selenium-server-standalone-2.46.0.jar -role hub

And nodes :

xvfb-run -a java -jar selenium-server-standalone-2.46.0.jar -role node -port 5454 -browser browserName=firefox -hub http://localhost:4444/grid/register

atfer start mvn test on 10 node i get next output :

Caused by: org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms

Results :

Failed tests: 
  AccountTabTime>Base.setUp:35 » WebDriver Unable to bind to locking port 7054 w...
testNG.Parallel.CheckInvoice.setUp(testNG.Parallel.CheckInvoice)
  Run 1: CheckInvoice>Base.setUp:35 » WebDriver Unable to bind to locking port 7054 wit...
  Run 2: CheckInvoice>Base.setUp:35 » WebDriver Unable to bind to locking port 7054 wit...

  OrderProducts>Base.setUp:35 » WebDriver Unable to bind to locking port 7054 wi...
  ProductsAndServices>Base.setUp:35 » WebDriver Unable to bind to locking port 7...
  RegisterIncident>Base.setUp:35 » WebDriver Unable to bind to locking port 7054...

Tests run: 15, Failures: 5, Errors: 0, Skipped: 6

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:32.217s
[INFO] Finished at: Sat Jul 25 09:46:57 CEST 2015
[INFO] Final Memory: 9M/115M

when i run mvn test on 1 node i get : Results :

Tests run: 10, Failures: 0, Errors: 0, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4:35.527s
[INFO] Finished at: Sat Jul 25 10:01:31 CEST 2015
[INFO] Final Memory: 12M/134M

So my question is: Why one one node all works fine and on 10 nodes maven runs more than 10 tests ? How i can fix this ?

Mikolaj
  • 21
  • 1
  • Are you sure this is how you want your testng.xml file to look like? I can see you listed twice all your 5 classes, and did than on test level. Why do you duplicate every single class? Why not just define one test node with just one package (as it is described here: http://automatictester.co.uk/2014/05/10/selecting-tests-to-be-run-via-testng-xml-file) and run every test just once? Also, don't worry about the test counts in TestNG execution summary. If you make use of Before* and After* methods, numbers in TestNG report can be far from straightforward. Fix failures, this will fix counts. – automatictester Jul 25 '15 at 12:22
  • Yes i need runs my tests parallel. One test in one thread. – Mikolaj Jul 25 '15 at 13:12
  • This is fine. You can achieve that with one test node with just one package, and thread-count set as needed. You don't need to specify multiple test nodes in you xml file. – automatictester Jul 25 '15 at 14:06
  • And what with "Caused by: org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms" ? When i start more than 10 test i get this error on nodes – Mikolaj Jul 25 '15 at 18:37

0 Answers0