cancel
Showing results for 
Search instead for 
Did you mean: 

How to Automate Tests in TestComplete

SOLVED
Highlighted
Occasional Contributor

How to Automate Tests in TestComplete

Hi,

 

I am trying to automate tests in TestComplete. I want to run my tests at a scheduled time (eg: 07: 00 PM every Thursday ) . Can anyone tell me how to accomplish this? My application is in C#

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: Automate Test in test complete

One more note:

 

In Windows Task Scheduler, you should actually make your program/script the CMD.EXE and then, in your arguements, put in the full commandline as per the documentation but proceeded with a /c.  

 

So, again, program/Script is CMD.EXE and commandline should look like this.

/c "C:\Program Files (x86)\SmartBear\TestComplete 14\x64\Bin\TestComplete.exe" "C:\Users\fciappadmin02\Documents\TestComplete 14 Projects\AutoSchedule\AutoSchedule.PJS" /Run /Exit /SilentMode

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

9 REPLIES 9
Highlighted
Community Hero

Re: Automate Test in test complete

Once you have your tests developed, the execution of them can be done in MANY different ways.

 

We use WIndows Task Schedular to set up designated times to run projects.

Some people use Jenkins

Some use Jira

Some use QA Complete

some use.... some other tool.

 

MOST of them start, in some way, with using the Command line execution of TestExecute (note.. NOT TestComplete... TestExecute... although they use the same command lines)

 

Start here

 

https://support.smartbear.com/testcomplete/docs/working-with/automating/index.html


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Leader

Re: Automate Test in test complete

Hi,

 

Just to complement what has been written before, he wants to add.

In TestComplete there is a type of project that is called "Network Suite". You can use it for CI integration in your project.

 

https://support.smartbear.com/testcomplete/docs/testing-with/advanced/distributed/processing/running...

Links to documentation - Preparation: https://support.smartbear.com/testcomplete/docs/working-with/integration/jenkins/preparing.html Freestyle: https://supp...
Highlighted
Occasional Contributor

Re: Automate Test in test complete

I am trying to use Windows Scheduler and was not successful.  See the steps below

 

1. Created a test project in TestComplete as  'Auto Schedule'. Added one keyword test 'Test2' under this.

2. Created a new Task under Task Scheduler.

3. Under Actions set the 'Program/Script' as ""C:\Program Files (x86)\SmartBear\TestComplete 14\x64\Bin\TestComplete.exe" 

4. 'Add arguments' as " "C:\Users\fciappadmin02\Documents\TestComplete 14 Projects\AutoSchedule\"

 

But when I tried to run the scheduler, it's showing me the message 'Launch Failure' . 

vsumathi_0-1590538179554.png

 

Highlighted
Community Hero

Re: Automate Test in test complete

The project is either a PJS or MDS file.  So, you passed it the folder for AutoSchedule but you didn't specify which file in that folder to open?  Is there an AutoSchedule.MDS file or AutoSchedule.PJS file in that folder?  That should be part of your parameters.

 

Additionally, as the documentation I linked to you mentioned, you need some other switches as well.  You need the /Run switch to actually execute the project.  Also, you'll need the /Exit switch to make sure that, once the project is executed, TestComplete is shut down.

 

Also, you need to make sure that your project is prepared properly.  While you have the test created, is it added as a Test Item in your project?  If so, just running the project should be fine.  If not, you may need to include additional switches to indicate what test (Keyword test, script module, etc) you want to execute.

 

It's all in the documentation. 


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Community Hero

Re: Automate Test in test complete

One more note:

 

In Windows Task Scheduler, you should actually make your program/script the CMD.EXE and then, in your arguements, put in the full commandline as per the documentation but proceeded with a /c.  

 

So, again, program/Script is CMD.EXE and commandline should look like this.

/c "C:\Program Files (x86)\SmartBear\TestComplete 14\x64\Bin\TestComplete.exe" "C:\Users\fciappadmin02\Documents\TestComplete 14 Projects\AutoSchedule\AutoSchedule.PJS" /Run /Exit /SilentMode

Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

View solution in original post

Highlighted
Occasional Contributor

Re: Automate Test in test complete

I am still getting an error. See my steps below

1. Created a project under E:\TestComplete\Vipin\ScheduleTest

Prj Folder.png

 

2. Add arguments : "E:\TestComplete\Vipin\ScheduleTest\ScheduleTest.pjs" /r /e

Arguments.png

 3. Run the scheduler, but received an error message

error.png

I am new to this application so not sure what I am missing. 😞

 

Highlighted
Occasional Contributor

Re: Automate Test in test complete

I forgot to mention the error. It is" Invalid Command Line. The project suite"E:\TestComplete............" was not found

Community Hero

Re: Automate Test in test complete

Someone selected a solution.  I'm assuming that was after this last message of yours? Because, again, the recommended way of doing this is to use the CMD.EXE with the /c switch for the whole commandline.


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Occasional Contributor

Re: Automate Test in test complete

Thanks, Robert. I was able to execute it using the recommended  command line

New Here?
Join us and watch the welcome video:
Announcements
Join TechCorner Challenge!
Want a fun and easy way to learn TestComplete? Try solving weekly TechCorner challenges and get into the Leaderboard!

Challenge Status

Changing options from outside of TestComplete

Participate!

How to execute remote test and obtain results via Test Runner REST API

Participate!

Comparing content of HTML table with Excel file data

Participate!

Compare HTML table with Excel file and correct data in the file

Participate!