Forum Discussion

romanmfs's avatar
romanmfs
Frequent Contributor
7 years ago

Silent Script not working

I had these scripts forever throughout my test cases and the y never broke until now. 

Not sure what has changed. 

 

This script I am using to "not save changes before closing" because i am running multiple test cases scheduled during the night.

 

Here is a script:

function SetSilentMode()
{
var rmNormal = 0;
var rmErrorAndWarning = 1;
var rmErrorOnly = 2;
var rmSilent = 3;

var tcManager = Sys.OleObject("TestComplete.TestCompleteApplication").Manager;
tcManager.RunMode = rmSilent;

 

 

Here is an error: 

JavaScript runtime error. Server execution failed, ClassID: {990BBECC-B5F4-478C-9E90-1758B3CE814C} Error location: Unit: "CCCS ES SUITE\CDN CACHE\Script\Silent" Line: 9 Column: 23.

JavaScript runtime error.

Server execution failed, ClassID: {990BBECC-B5F4-478C-9E90-1758B3CE814C}

Error location:
Unit: "CCCS ES SUITE\CDN CACHE\Script\Silent"
Line: 9 Column: 23.
  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    When I ran TC 12.50 and went to the object browser, in the Sys node there, I can, in the OleObject property, put that parameter in.  When I do so, I get first a message "TestComplete is already running" and, if I close that, I get the error.

    So....  why it used to work and doesn't now I don't know... If you upgraded TestComplete recently, that might have something to do with it.  

    However... I question the need for this script.  If you are running the tests overnight unattended, you can trigger execution via commandline and, in the commandline, add the switch "/SilentMode" which will do what you want without needing to run any script code at all.

  • romanmfs's avatar
    romanmfs
    Frequent Contributor

    Hi, so im back at it again. 

    I had disabled the scripts and added additional arguments to my task scheduler at the end thinking it would work.

    "D:\TC\PROJECTS\CCCS_ES\CCCS ES SUITE\CCCS ES SUITE.pjs" /r /e/ SilentMode

     

    What am i doing wrong here?

     

    All I did was adding "SilentMode" at the end expecting it to do the same what the script was suppose to do- close TC after running w/o asking to save so the next scheduled test case runs with no issues.

     

    tristaanogre

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      I can't tell you what you're doing wrong until you tell me what's NOT happening. At first glance, you are missing a space after the /e and you have an extra space before SilentMode but it's hard to tell if that's just a typo or if that's your actually command line.

      The FULL commandline genrated by Windows Task Schedulur should be something like

       

      cmd.exe /c "%programfiles%\SmartBear\TestComplete 12\bin\testComplete.exe" "D:\TC\Projects\CCCS_ES_CCCS ES SUITE\CCCS ES SUITE.pjs" /r /e /SilentMode

      so... what's going wrong?  Please post your FULL command line exactly as you have it entered... if necessary, post screenshots.