Forum Discussion

SaravanaKumar_N's avatar
SaravanaKumar_N
Contributor
10 years ago

"Interactive user session" issue with TestComplete and Jenkins Integration

Hi All,

We are trying to schedule a run with Jenkins in our VM. Everything is done as per the suggestion provided in the article "http://support.smartbear.com/viewarticle/73663/".
To summarize...
1. Jenkins Slave is configured using JNLP and corresponding "jenkins-slave" windows service is up.
2. Job is created with "Run interactive user session" option.
3. TestComplete version - v10.60

Job ran but we got the following warning in Jenkins...
"[TestComplete] [WARNING] The node is connected via Java Web Start (JNLP). In this mode, the "Run interactive user session" property of the TestComplete Test step is ignored. TestComplete (or TestExecute) will work in the current user session."

In TestComplete the logs shows the following error...
"The action cannot be executed at this session state (1)."

Could any one please help us to overcome this issue.

Thanks,
Saravana

  • SaravanaKumar_N's avatar
    SaravanaKumar_N
    8 years ago

    Hi all,

    Thanks everyone for their inputs that gave us the insight of this issue. After lot of research able to find the the issue and resolved it now.

    So here is what we have did and its running smoothly now.

     

    1. Configure Jenkins slave to launch via 'Java web start'.

    2. At slave VM, configure AutoLogin (recommend to use the AutoLogin software) and set the user to login.

    3. Create a batch file to start the Jenkins Slave at VM.

    4. Create a TaskScheduler for above batch file and set it up for the login user (defined at Step-2).

    5. Set the above task to trigger at 'At system startup', and it is advisable to give a delayed start like 2 min incase if you face 'session is not-interactive' issue again.

    6. Also remove if legalnotiecaption and legalnoticetext registry entries, which would prompt at each login. This would block Auto-login step.

    - This can be found under - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Current Version\Policies\System.

    - Else could be defined at Local Group Policy editor as well. Your Sys admin can help to disable it.

     

    7. Finally, if you login to the VM that was running the test and if you want to disconnect. Then create a batch file for the following command and just double-click it, the system would disconnect and session would be available for Jenkins for the next interactive run.

    for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (
    %windir%\System32\tscon.exe %%s /dest:console
    )

     

    Once again, thanks everyone.

  • sha's avatar
    sha
    Contributor

    I'm am not an expert in this, but I have a solution up and running, so a couple of clues:

     

    The warning you get is not harmful. We get the same warning and have no problems.

    Do you have launch method on the node to 'Java Web Start' in Jenkins node setup?

    'Run interactive user session' should be fine as well. Set 'Use active session' to true. (And make sure there is an active session).

     

    Søren Harder, QA, Zmags

    • SaravanaKumar_N's avatar
      SaravanaKumar_N
      Contributor

      Thanks a lot for the reply Soren.

       

      Yes, we have launch method as "Launch slave agents via Java Web Start".

      We have the Slave Service also running at Slave end.

       

      I have tried with "Use active session" and also without that option. Both has thrown the "User session is invalid error"

      (Please refer the attached screenshot).

       

      By active session, you mean that there should be a session logged in with the user that we are given for "Run interactive user session" option? If so I have tried that also; with the same user logged in and without logged in.

       

      Is there any other additional setup that we have to do in Slave machine (we are using VM)?

       

      Thanks,

      Saravana

    • TanyaYatskovska's avatar
      TanyaYatskovska
      SmartBear Alumni (Retired)

      Hi Saravana,

       

      Here are some steps to check:

      1. First of all, please make sure that you are using the latest Jenkins plugin version. You can download it here.
      2. Depending on the way you are launching JNLP, check the following:
        1. If JNLP is launched as an application, there is no need to enable the “Run interactive user session” option. So, disable it.
        2. If JNLP is launched as a service, please double check if the “Run interactive user session” option is enabled. If it’s, I recommend that you refer this issue to our TestComplete Support Team so they could investigate it. You can reach out to them here: http://support.smartbear.com/product-list/
      • SaravanaKumar_N's avatar
        SaravanaKumar_N
        Contributor

        Yes Tanya, we are using the latest plugin and launching the slave "JNLP as a service", had enabled the “Run interactive user session” option. No luck.

         

        Will investigate further, if we could not make any progress, will contact support team.

         

        Thank you Tanya.

        ~ Saravana

  • sha's avatar
    sha
    Contributor

    The last couple of mails made me read your problem again. As mentioned we have a solution up and running in Jenkins without problems. The first message you mention ('The node is connected via Java Web Start (JNLP). In this mode, the "Run interactive user session" property of the TestComplete Test step is ignored.') is not something you should be concerned about.

     

    The second message ('The action cannot be executed at this session state (1).') could perhaps indicate that you are running headlessly. Try to log into the VM using VNC (not RDP!) and see what is going on while the test is running. If nothing is going on, I cannot help you, but possibly this will actually fix the problem for you. (And it should stay fixed even if you close the VNC from your computer).

     

    Søren Harder, QA, Zmags

    • SaravanaKumar_N's avatar
      SaravanaKumar_N
      Contributor

      Thanks a lot for your concern sha.

       

      But as of now I have been moved to another Project. I have suggested this solution to the team that currently working on, will get back to you.