Forum Discussion

abrar22's avatar
abrar22
Frequent Contributor
9 years ago

Running Tests every Night on new Build

Hi,

 

I have good amount of tests which I want to run every night when new build is out. Can someone help me how I can do that while taking the new build for the application everynight and then running the tests

9 Replies

    • abrar22's avatar
      abrar22
      Frequent Contributor

      hanks,

       

      In Command Line how can I specify against which new build i can run the tests and at what time ?

       

      Thanks

      A

      • SmartBearDan's avatar
        SmartBearDan
        SmartBear Alumni (Retired)

        Hello abrar22,

         

        There's no place in the command line interface to specify a time, it will run whenever you send the command.  There are many tools out there that can be used to send a command at a certain time, including QAComplete (which I linked before) or even Windows Task Scheduler.  Windows Task Scheduler is included in Windows.

         

        -Dan

  • jpr347's avatar
    jpr347
    Occasional Contributor

    Hi Abrar22

     

     

    Implementation:

     

    We use TestExecute running on different PC.

     

    We then created a network project containing a single Host (PC) and a task containing a job which is the main project suite and the PC.

     

    Right-clicking the Network Suite >Verify to copy the current tests across to a the TE shared project folder. 

     

     

    Scheduled Running:

     

    We use MS task scheduler to run TestExecute with a command line option to run the Project which actuall runs every 5 minutes although our tests take a lot longer than that.  This means the largest gap we have between tests is 5 minutes.

    We experimented with the TE command line options to get the syntax right.

     

    Reporting:

     

    From TC, it is possible to open the Project in the TestExecute shared folder and examine the logs in the morning.  We prefer this over email, web reports, TFS task creation etc.   The first time you do this you get a prompt asking if you'd like to make this folder a shared project.  Click "No"

     

    Updating the Test Environment with the latest build:

     

    We have a staging folder on a server which I copy the latest .MSI packages and SQL Server databases (using batch files).

    The first Top Level Parent test in our suite checks this folder and does the necessary installs and upgrades. The other tests will not run unless this is successful.  If there's no upgrades available it simple continues the tests, 

     

    Our solution is a loose integration with TE and would not be suitable for Synchronised tests.

     

    Which ever method you choose my only advice is to investigate the differernt options, and trial them to see how it works for you.

     

    Hope this helps

     

    • Colin_McCrae's avatar
      Colin_McCrae
      Community Hero

      I suspect it depends what build method/engine you're using.

       

      Using TeamCity, our build guy was able to do the build, deploy the latest version to a test VM. Pull down the latest version of my TestComplete project from version control and execute it using TestExecute. The build developer looked after pretty much all of this. I only had to tell him where the project files were and provide him with a BAT file to start TestExecute.

       

      Once running, we use a VNC client to remote in and out of the test VM as it doesn't break the user session like RDP does.

       

      And you need to make sure the VM it runs on is not started running Windows as a service as TestExecute requires an active user session.

       

      But this may change entirely depending on your buld setup. As you can probably guess as you now have several different ways to achieve the same thing ....

    • abrar22's avatar
      abrar22
      Frequent Contributor

      Thanks

       

      Is CommandLine only executed via TestExecute?

       

      A

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        ?

         

        You mean the other way round?

         

        aka - is Test Execute only executed via Command Line?

         

        In which case ....

         

        No. It's an application. It can be started in the same way as most applications. Batch/Command Line is one option. And a good one if you're starting it remotely/automatically as you can pass in a bunch of parameters/switches to tell it what to run, run in silent mode, etc etc.

         

        https://support.smartbear.com/viewarticle/67552/