Forum Discussion

nounge's avatar
nounge
Occasional Contributor
8 years ago

TestComplete12: Excel sheet not found error when executing as batch

On TestComplete 9, I was using the Windows Task Scheduler to run a suite of (scripted) tests by command line execution every day. I also use Excel to parameterize input for the tests. This had been working fine.

 

Recently, I upgraded to TestComplete 12. I adjusted the execution command appropriately (executable path etc.). Now, when I execute the command through Task Scheduler or as a batch, the test suite fails to execute. Each and every test begins, reports an Excel sheet not found (when retrieving the parameterized input), then continues to the next test.

 

This process happens for the entire project suite instantly.

 

However, when I execute the exact same command by executing it through Windows Run program (instantaneous), it runs without any issues.

 

While I can still execute the test suite, the loss of autonomy is undesirable. Does anybody have any work around or solution to this issue? Is it simply a lacking feature (or rather loss of due to TestComplete 9's ability)? I would appreciate any help.

 

Here is the command I use:

 

"C:\SmartBear\TestComplete 12\Bin\TestComplete.exe" "<project suite path>.pjs" /r /p:<project>/exportLog:"<results export path>.mht" /e /SilentMode

 

Note: The original TestComple 9 command I used was the exact same-except for the executable path and /SilentMode. SilentMode was added to suppress the Save dialog that appears after exiting (new log reference - new feature from  9 to 12). I have tried all variations with/without /SilentMode and /e.

  • I'm still thinking it's a permissions thing in some way...  Running it at the "Run" prompt in windows is running it using your user account.  Running it as a task in task scheduler or as a batch, potentially, may be using a different user account or privilege level or, if it's running as you, it MIGHT not be running with the most elevated privileges you have (admin).

     

    Try in your task setting the security options to have it run as an administrator. I know it seems strange, but give it a shot and see if that works.

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Here's my guess without knowing the specifics of your project or your environment.

    Your excel sheet in TC is referenced using some sort of relative pathing. Because you are running the scripts now from a different executable path and, potentially, even a different project path, that relative pathing may not be pointing to your Excel sheet any more.

     

     

    Here's another guess: the task scheduler I think has something like a "Start in" option?  Is it possible that, because of the change in executable path, that you've lost the relative pathing in that manner.  Check your start in on your task.

    Either way, it seems to be a problem, not with TC 12, but with the scheduling of the task and the context in which the task is run.

    • nounge's avatar
      nounge
      Occasional Contributor

      I understand that you would believe the paths to be the issue due to the error message. I considered it as well. However, the paths are not declared relatively in the command. This is verified by the fact that the command works perfectly through a normal Command Prompt.

       

      I am not using the Start in option. For the sake of simplifying the solution, we can neglect Task Scheduler. The command does not work when inserted into a batch call.

      • tristaanogre's avatar
        tristaanogre
        Esteemed Contributor

        Hrm... what about permissions elevation? Is it possible that when running as a batch/task that the persmissions aren't sufficient to get to the Excel sheet?

        Could you post the code that is accessing your excel sheet or a screenshot showing the configuration if you have it in a Project variable or Keyword Test Variable?