Forum Discussion

nisgupta's avatar
nisgupta
Valued Contributor
6 years ago

Window task scheduler + Firefox Preferences error

We are running TestComplete tests on TestExecute machine using Window Task Scheduler. The browser we are using is Firefox 69.0.3. Testexecute version is 14.20. OS Window Server 2012R2

 

We have set the Task scheduler - to run the test every hour for 9 hrs.. We are getting the errors

 

You are trying to call the "Preferences" method or property of the "Sys.Browser("firefox")" object that does not exist.

You are trying to call the "setBoolPref" method or property of the "Sys.Browser("firefox").Preferences" object that does not exist.

 

No idea why it happens. We run manually the same test then no error and it work 

 

 

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    The text of the message sounds like the browser was not started. Or not found by TestComplete. The latter may happen if the browser is started outside of TestComplete and with higher privileges than TestComplete.

    Just to be on the safe side: when the sheduled task is executed you do have active not locked user session and the task is configured to start interactively within this session, isn't it?

     

    • nisgupta's avatar
      nisgupta
      Valued Contributor

      AlexKaras 

       

      here is what I am doing .

       

      1. Remote desktop login to Testexecute machine

      2. Create the batch file for testComplete project 

      3. Create the Window  Scheduler and attach the batch file.

      4. Set up the Trigger in the window scheduler - every 5 min and run upto 15 mins.

      5. Ran the tscon utility from command line https://support.smartbear.com/testcomplete/docs/testing-with/running/via-rdp/keeping-computer-unlocked.html

      6. Close the Remote desktop Window.

       

      I am getting the errors if the Remote desktop window is closed. But if i keep it open then no issues. I am expecting after running the tscon utility from the command line we can close the remote desktop window and the Tests will run.

       

      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        As per help article that you've referenced, tscon "returns the control to the original local session on the remote computer, bypassing the logon screen."

        By default, Windows Scheduler runs on behalf of Local System account (which does not have user desktop).

        You may configure your task so that it starts only when the certain user is logged-on - this is what must be done.

         

        However:

        > 5. Ran the tscon utility from command line [...]

        > 6. Close the Remote desktop Window.

        tscon requires administrative privileges in order to switch sessions. If it is started with proper permissions, Remote Desktop window is closed by the system when session is switched. The fact that you mention step 6 and your followup comment makes me think that your accound does not have elevated administrative permissions (Run As Administrator), thus session is not switched and your desktop is just closed by the system when you close your RDP window.

         

        every 5 min and run upto 15 mins.

        TestComplete and TestExecute are single-instance applications. Even more - TestComplete cannot be started if TestExecute is running and vise versa. Thus, in order to be on the safe side, I would recommend to have launch frequency lower then the execution timeout.

         

        3. Create the Window  Scheduler and attach the batch file.

        Depending on how you start batch file execution, task will or will not wait for the batch to end execution. In addition, batch itself may or may not wait for the TestExecute to close. If the task does not wait for the batch to finish its job and batch does not wait for TestExecute, then the task will be completed within a second or two, while TestExecute may appear to be running for more then 5 minutes and this will prevent its subsequent start when the task is triggered again.