locked
How to prevent closing session when remote desktop is closed or we logged of? RRS feed

  • Question

  • Hello,

    It's known when we execute Coded UI tests on physical remote desktop computer and its window is minimized, closed or we logged off the tests fail. The reason is the session should be active to do all the UI actions.

    I'm just wondering if it's possible to prevent closing session directly from the code? I mean could we write some code from our Coded UI tests that would prevent closing session?

    Can we use any other way to workaround this? For example, executing tests from command line using tcm.exe.

    Thank you in advance.

    Goran

     

    Friday, November 12, 2010 9:20 AM

Answers

  • You have to have an interative session for running UI tests, so if your remote desktop window is minimized or closed you will lose interactive session and UI Tests would fail.

    As a workaround you can do TS on a third machine and from there you can TS on your test run machine, so even if you are closing the remote deskto session of the third machine, you will not lose interactive session

     

    Thanks

    Aditya


    Aditya Kumar Agrawat (MSFT)
    • Proposed as answer by Aditya_msft Saturday, November 13, 2010 1:43 PM
    • Marked as answer by tesicg Monday, November 15, 2010 7:37 AM
    Saturday, November 13, 2010 1:43 PM

All replies

  • You have to have an interative session for running UI tests, so if your remote desktop window is minimized or closed you will lose interactive session and UI Tests would fail.

    As a workaround you can do TS on a third machine and from there you can TS on your test run machine, so even if you are closing the remote deskto session of the third machine, you will not lose interactive session

     

    Thanks

    Aditya


    Aditya Kumar Agrawat (MSFT)
    • Proposed as answer by Aditya_msft Saturday, November 13, 2010 1:43 PM
    • Marked as answer by tesicg Monday, November 15, 2010 7:37 AM
    Saturday, November 13, 2010 1:43 PM
  • Excuse me, you wrote:

    "As a workaround you can do TS..."

    What does TS stand for?

     

    Saturday, November 13, 2010 1:59 PM
  • TS = remote desktop


    Thanks & Regards Siddhartha
    Saturday, November 13, 2010 2:01 PM
    Moderator
  • Excuse me, but I'm not sure what you mean.

    Here's what happens in my case.

    I have 3 computers:

    1) PC1 (local desktop) - My desktop computer. It's under Windows XP. But I'm not doing any development or executing tests from that machine. It's come kind of entry point.

    2) PC2 (remote desktop) - I'm opening from PC1 remote desktop with Windows Server 2008 where MTM (Microsoft Test Manager) and Test Controler are.

    3) PC3 (remote desktop) - I'm opening from PC1 remote desktop with Windows Server 2008 where Test Agent is.

    I'm executing Coded UI test from MTM from PC2 on PC3 and when window with PC3 is open everything works fine. When I minimize or close or log off from PC3, the test fails.

    What should I do in this scenario?

     

    Saturday, November 13, 2010 2:13 PM
  • Log in to PC3 from PC2 and keep the remote desktop session opened there.

     


    Aditya Kumar Agrawat (MSFT)
    Monday, November 15, 2010 2:21 AM
  • Thank you for your efforts to help me, but if you meant on log on from PC2 to PC3 remote desktop from inside PC2, the tests fail.

    It works in this way:

    1) Include one more remote desktop in a whole story, PC4 that will act as "intermediate" remote desktop.

    2) Log on to PC2 as remote desktop.

    3) Log on from PC2 to PC4 as remote desktop.

    4) Log on from PC4 to PC3 as remote desktop inside PC2.

    5) Run Coded UI tests from MTM from PC2 to PC3.

    6) The tests pass even if you minimize the windows with PC4 where PC3 window is open as well.

    I hope this can help someone.

     

    Monday, November 15, 2010 7:35 AM