Issue in launching ClickOnce application from Window Task scheduler

Originally posted by nishantranjan on June 08, 2026

I am currently using the 15 day trial version of TestComplete to automate a test flow for my existing application, and I have successfully set up the automation — it works as expected when run directly through TestComplete or running using command prompt

However, I am encountering an issue when triggering the same test via the Windows Task Scheduler.

Here is what my test is designed to do:

  1. Launch a URL that downloads a ClickOnce application to the Downloads folder.
  2. Launch the downloaded ClickOnce application. (Doesn’t Install)
  3. Log in to the application.
  4. Perform a set of predefined activities.
  5. Exit the application.

The problem: When the test is executed through Windows Task Scheduler, the URL launches successfully and the application downloads as expected. However, the ClickOnce application never launches after the download completes and my Test fails. I have tried by setting “Run only when user is logged on” in Task scheduler but it doesn’t resolve the issue.

Could you please advise:

  • Are there any known limitations with TestComplete and ClickOnce applications when executed via Windows Task Scheduler?
  • Is there a recommended workaround or configuration to resolve this issue?

Any guidance would be greatly appreciated.

Originally posted by rraghvani on June 09, 2026

What is the exact message that appears when your test fails?

Can the ClickOnce app be automated by TestComplete?

Originally posted by nishantranjan on June 09, 2026

No Error message. It doesn’t launch the application and next step is login. it doesn’t find any window/textbox to fill username so it returns error that username textbox not found.

When running the same script directly from Test Complete then every thing is working fine.

Originally posted by rraghvani on June 09, 2026

Just for my understanding. Why is it necessary to automate ClickOnce application? Is that your UAT application?

Originally posted by nishantranjan on June 09, 2026

Just think like this. We have exe. we double click it to run and then perform what ever we want to do.
In my case, Instead of exe i have clickonce.application which on doubleclick launches the application. Scheduler starts the script, downloads the appliction but This doubleclick action to launch my application is not working from task scheduler.

Every thing works perfectly when running script directly from TestComplete or using command prompt , but when i use the command to run my script from task scheduler then it doesn’t launch application.

Originally posted by nishantranjan on June 09, 2026

Any Suggestion

Originally posted by rraghvani on June 10, 2026

When running the scripts via the schedular, is the UI present? Without a UI, TestComplete is not able to interact with the AUT

Originally posted by nishantranjan on June 10, 2026

Which UI? From schedular, Testcomplete starts, start executing my script, launches the url, downloads the clickonce application but doesn’t open it.

Originally posted by rraghvani on June 10, 2026

When running TestComplete, you need to have an interactive Windows user session with a UI.

Question - is your Task Schedule triggering the TestComplete srcipts? If yes, does TestComplete then launch the browser and downloads the ClickOnce application? Which application then launches ClickOnce?

Originally posted by nishantranjan on June 10, 2026

is your Task Schedule triggering the TestComplete srcipts? YES
If yes, does TestComplete then launch the browser and downloads the ClickOnce application? YES
Which application then launches ClickOnce? TestComplete (TestedApps.Rundll.Run)

Originally posted by rraghvani on June 10, 2026

Great. While the automation is running, is there an active interactive Windows user session available? For example, is a user logged in with access to the desktop UI?

If the machine is locked or running without an interactive desktop session, TestComplete will be unable to interact with the application’s user interface, causing the test to fail.

TestComplete requires an active interactive user session to access and automate the GUI of the application under test (AUT). Without an interactive session, the test engine cannot interact with UI elements, and the automated tests will not run successfully.

Originally posted by nishantranjan on June 10, 2026

Yes, user is logged in. While user is active-logged in watching the desktop, Task scheduler runs the Testcomplete script and url launch and download happens.

Originally posted by rraghvani on June 10, 2026

Could you verify whether the ClickOnce launcher is actually starting - after the scheduled task runs, check Task Manager for:

dfsvc.exe and rundll32.exe

If none appear, then ClickOnce activation step is failing before the application starts.

How is TestComplete launching the ClickOnce application? What are the exact parameters?

Originally posted by nishantranjan on June 10, 2026

TestedApps.rundll323.Run(1, true)
Launches when we run the script directly from TestComplete or command prompt.

Not launches when run from Task scheduler

Originally posted by rraghvani on June 11, 2026

Where are you getting “TestedApps.rundll323.Run(1, true)” from?

Originally posted by nishantranjan on June 11, 2026

.tcTAs file in my project

Originally posted by rraghvani on June 11, 2026

That’s a configuration file, specific to TestComplete. You should be referring to Managing Tested Applications. You need to ensure that the TestedApps is configured correctly to launch the ClickOnce application.

Originally posted by nishantranjan on June 11, 2026

ok, So i got it working by using

var wshShell = Sys.OleObject(“WScript.Shell”);

wshShell.Run(‘"’ + appPath + ‘"’);

Now my script is working fine from manual run, command prompt run or task scheduler run

But now i am facing another issue.

If my system is logged off, I re-login again then my task schedular is having same previous issue.

Now if i run my script manually from TaskComplete before my next task scheduler run then next time task scheduler runs script and no issue occurs.

Why this manual run issue is occurring on re-login to system

Originally posted by rraghvani on June 11, 2026

Without seeing any code or configurations, it becomes a guessing game!

Originally posted by nishantranjan on June 11, 2026

Yes, that right.
One information, you said
"When running TestComplete, you need to have an interactive Windows user session with a UI. "

Is there any way to run TestComplete when logged off or in non interactive session? Is that possible or TestComplete doesn’t allow this at all?