Thursday, August 24, 2017

JENKINS Time based Scheduling the Test run



# Starting nightly builds for regression testing in continous integration.

Step1:
Add a new Jenkins job.
select : Freestyle project.

Step2:
In "build Triggers"
select checkbox : Build Periodically.
enter the following : 15 13 * * *

this will auto schedule the jenkins job to start the build every day of every month of every year at the 15th minute of the 13th hour of the day.

The Jenkins used is a cron expression, the different fields are :

MINUTES Minutes in one hour (0-59)
HOURS Hours in one day (0-23)
DAYMONTH Day in a month (1-31)
MONTH Month in a year (1-12)
DAYWEEK Day of the week (0-7) where 0 and 7 are sunday

If you want to schedule your build every 5 minutes, this will do the job : */5 * * * *

If you want to schedule your build every day at 8h00, this will do the job : 0 8 * * *

Jenkins lets you set up multiple times, separated by line breaks.
If you need it to build daily at 7am, along with every Sunday at 4pm, the below works well

H 7 * * *
H 16 * * 0


step3:
In build: select "execute windows batch command"
add the path to the batch file like :

C:\Users\Administrator\Desktop\testbatchfile\MQTT_ENERGY.bat

step4:
save.

-------------------------------
#Two ways to Set the duration of the test  :
1a. by adding the "scheduler" in the Thread group.
1b. And adding the value in the user.properties
duration=3600
'OR'
2. the test duration value can be provided in realtime at time of test execution via cmd. this value then overwrites the user.properties duration property.
-------------------------------

Json extractor and While loop

Waiting for a specific value in response of api request. using while loop. Add a While Loop. The api requets will be executed inside th...