0

I am using jenkinn+selenium grid plugin to execute my testNG tests selenium

i have two bat files:

a. ffnode.bat - this register the node. content is as below

cd [path of the selenium jars]

java -jar selenium-server-standalone-2.53.1.jar -role node hub http://localhost:4444/wd/hub -browser browserName=firefox -port 5556

b. testngcmd.bat - To execute tests. content is as below

cd [my project path]

set ProjectPath=C:\Users\hp\Workspace-ActivateRegression\Regression

echo %ProjectPath%

set classpath=%ProjectPath%\bin;%ProjectPath%\jars*

echo %classpath%

java org.testng.TestNG %ProjectPath%\testng.xml

Now in my jenkinn project >> Build env >> execute winddow batch command >> bat file path >> i ask jenkinn to execute these two bat files - ffnode.bat and then testngcmd.bat

Nothing happens after execution of ffnode.bat Only a waiting sign appears in console output

enter image description here However if i manually execute these two file then tests run fine.

Also if i manually run ffnode and then testngcmd(using jenkinn) then als the test runs fine

Problem is only when both bat files are called using jenkin

Pawan
  • 153
  • 2
  • 3
  • 15
  • How do you execute these two batch files manually ? Do you open up two separate command windows and then run each of the batch files in one of the terminals ? I am guessing that Jenkins is perhaps waiting for your ffnode.bat to run to completion. – Krishnan Mahadevan Sep 08 '16 at 15:33
  • @KrishnanMahadevan Yes, I execute both the files in different windows manually. I first run ffnode.bat and then the testngcmd.bat. this way they run just fine. however when jenkins execute ffnode.bat and then it just waits for testngcmd.bat to run forever. – Pawan Sep 09 '16 at 05:40
  • Try adding "start" to your java command in your batch file and see if that helps [ Refer here http://stackoverflow.com/a/6473203/679824]. I don't think Jenkins is even getting to the point of running your second batch file. Its just getting stuck with executing the first one. – Krishnan Mahadevan Sep 09 '16 at 06:02
  • adding "start" dint worked. You may be right by saying "Jenkins is not even getting to the point of running your second batch file" however i am wondering how every thing goes fine when bat files are run manually. – Pawan Sep 09 '16 at 12:34
  • Update: I added start [call testngcmd.bat] in ffnode.bat. Adding "start" dint worked. – Pawan Sep 09 '16 at 12:42

0 Answers0