Selenium IDE Scheduler Has Arrived – Part 3

In part 2, you created a new job and scheduled a test suite to run every 5 minutes. In this part, I am going to show you how to modify the job to be scheduled at various times.

Let us open the scheduler dialog box and edit the job that we created in the previous part. Last time we used the shortcut of simply clicking the scheduler toolbar button and letting it create a new job for us. Since, a job already exists, we cannot use that shortcut any more. You can open the scheduler dialog box using any of the two ways mentioned in the part 1, viz., using the Play test suites periodically menu item from the scheduler toolbar button menu or using the Schedule tests to run periodically menu item from the Options menu of Selenium IDE. Both will open the scheduler dialog box and automatically start editing the first job. Here is what you get.

Scheduler-editFirstJob

The first change to notice is that the tab now says Edit Job instead of New Job. The Edit job tab shows exactly the same details as the New Job tab. If you have the same test suite scheduled at same or different times with the same title, the scheduler will not stop you from doing so. It will simply run your jobs as many times as you schedule it. However, you may have a slightly difficult time identifying one job from the other.

As you check and uncheck the schedule check boxes, the time when the job will be run next will be automatically calculated and shown at the bottom right corner of the schedule portion of the job. Try clicking on a few check boxes and see it change. Here is how it looks.

Scheduler-runDate

If you have an invalid schedule, it will also gently alert you that something is wrong. Here is a screen shot where there is no valid schedule, in this case, no minutes have been checked.

Scheduler-needsMinutes

While it alerts you that the schedule is invalid, the scheduler does not stop you from saving a job with an invalid scheduler. It is currently used as a dirty trick to disable a job without deleting it.

The check boxes at the heading of each column of check boxes, lets you check or uncheck all the check boxes in that column. This is a quick way to check or uncheck the check boxes when you want to set a schedule. As an exercise, set this job to run every day at 8:30 am. To do so, click on both the Hour heading check boxes and the Minute header check box to clear all the hour and minute check boxes. Then click on the 08 check box in the hour part and click on the 30 check box in the Minute part. Check the next run date to verify that the next time this test suite will be run is indeed 8:30 am on the next day.

Scheduler-everyDayAt830

Now change the schedule so that it runs on every Monday at 8:30 am. That should be easy. Click on the heading check box of the Day column to clear all the Day check boxes. Then click on the Monday check box. Verify that the next run date is shown correctly.

Scheduler-MondayAt830

Here is a nice schedule for you. Create a schedule to run this test suite every working day every 30 minutes during working hours. Since this can change from country to country and workplace to workplace, let us assume for this exercise that a working day is Monday through Friday and working hours are from 9 am to 6 pm. Here is what it should look like.

Scheduler-workingHours

What if the working hours are 9:30 am to 5:30 pm? Can you set a schedule that runs every half hour during these working hours? Give it a try. You cannot. There are some schedules that you cannot achieve with a single schedule. You can however create multiple jobs with each of their schedules set so that together the test suite is run as you want. In this particular case, the first schedule would run the test suite from Monday through Friday from 10 am to 5 pm at every half hour similar to what you already did. Then another job to run the same test suite from Monday through Friday at 9:30 am.

What if you want to run a test suite at say 9:53 am or any time other than a five minute interval? Imagine that there were 60 check boxes for the minute. Now imagine you were clicking on those 60 check boxes for this job. Now imagine you were clicking on those 60 check boxes for the next job. When I started implementing this feature I decided that a 5 minute is probably enough for most people. There is a workaround, but if your business requires more precision and you are still using Selenium IDE, we should probably talk.

In this part you gained a better understanding on how the schedules work and how to set different schedules to run your test suites at various times. In part 4, we will take a look at setting the schedules using ways other than clicking check boxes.

This entry was posted in Selenium IDE and tagged , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *