Automation Scripts Fail when RDP(VM) is minimized










0















I have been facing issue with automation execution of my script on one of the VM. I have automated the functionality of Saving a Document which is ideally a Windows Designed UI. I have tried using various technologies/tools like AutoIT, Python, Sikuli but the script halts if VM is minimized. It works perfectly fine is VM is open via RDP and I can see runtime execution. But If I minimize the RDP, the script halts at 'Save As' dialog box, none of the send keys (Cntrl+s) or (Enter) work via AutoIt script. Please help with some solution so as to have successfully execution of script even in minimized mode.










share|improve this question






















  • Sikulis is actually processing whatever physically appears on the screen. If it's not there, Sikuli won't "see" it.

    – Eugene S
    Nov 14 '18 at 13:38















0















I have been facing issue with automation execution of my script on one of the VM. I have automated the functionality of Saving a Document which is ideally a Windows Designed UI. I have tried using various technologies/tools like AutoIT, Python, Sikuli but the script halts if VM is minimized. It works perfectly fine is VM is open via RDP and I can see runtime execution. But If I minimize the RDP, the script halts at 'Save As' dialog box, none of the send keys (Cntrl+s) or (Enter) work via AutoIt script. Please help with some solution so as to have successfully execution of script even in minimized mode.










share|improve this question






















  • Sikulis is actually processing whatever physically appears on the screen. If it's not there, Sikuli won't "see" it.

    – Eugene S
    Nov 14 '18 at 13:38













0












0








0








I have been facing issue with automation execution of my script on one of the VM. I have automated the functionality of Saving a Document which is ideally a Windows Designed UI. I have tried using various technologies/tools like AutoIT, Python, Sikuli but the script halts if VM is minimized. It works perfectly fine is VM is open via RDP and I can see runtime execution. But If I minimize the RDP, the script halts at 'Save As' dialog box, none of the send keys (Cntrl+s) or (Enter) work via AutoIt script. Please help with some solution so as to have successfully execution of script even in minimized mode.










share|improve this question














I have been facing issue with automation execution of my script on one of the VM. I have automated the functionality of Saving a Document which is ideally a Windows Designed UI. I have tried using various technologies/tools like AutoIT, Python, Sikuli but the script halts if VM is minimized. It works perfectly fine is VM is open via RDP and I can see runtime execution. But If I minimize the RDP, the script halts at 'Save As' dialog box, none of the send keys (Cntrl+s) or (Enter) work via AutoIt script. Please help with some solution so as to have successfully execution of script even in minimized mode.







python selenium autoit sikuli






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 14 '18 at 10:16









Arti ChetwaniArti Chetwani

41




41












  • Sikulis is actually processing whatever physically appears on the screen. If it's not there, Sikuli won't "see" it.

    – Eugene S
    Nov 14 '18 at 13:38

















  • Sikulis is actually processing whatever physically appears on the screen. If it's not there, Sikuli won't "see" it.

    – Eugene S
    Nov 14 '18 at 13:38
















Sikulis is actually processing whatever physically appears on the screen. If it's not there, Sikuli won't "see" it.

– Eugene S
Nov 14 '18 at 13:38





Sikulis is actually processing whatever physically appears on the screen. If it's not there, Sikuli won't "see" it.

– Eugene S
Nov 14 '18 at 13:38












2 Answers
2






active

oldest

votes


















2














The reason why your script fails when it gets executed over a minimized RDP session is quite simple. GUI automation/testing tools need to have an unlocked, active desktop - otherwise the operation system thinks that it doesn't need to actually render GUI operations (which is time consuming) since there no user can that can see the rendered graphical user interface anyway. And programs don't communicate via GUIs normally ...



This is why QF-Test and other GUI automation/testing tools often have a note in their FAQs describing this kind of problem. For example FAQ 14 in the case of QF-Test, see https://www.qfs.de/qf-test-handbuch/lc/manual-en-faq.html



As described in the FAQ 14 on Windows 10 or Windows Server 2016 and in case of an RDP connection you need to modify the Registry. Go to



HKEY_CURRENT_USERSoftwareMicrosoftTerminal Server Client


and add a new value



RemoteDesktop_SuppressWhenMinimized as DWORD having the value 2


After restarting you will then be able to minimize the RDP connections. However disconnecing or closing the RDP connection will probably still result in a failure.






share|improve this answer























  • Thanks I do agree, But is this behavior also expected with tools AutoIT and Sikuli as well? How about Python encoding to open the window and send controls to Save As dialog?

    – Arti Chetwani
    Nov 14 '18 at 11:30











  • Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt.

    – Arti Chetwani
    Nov 14 '18 at 11:33











  • @ArtiChetwani But is this behavior also expected with tools AutoIT and Sikuli as well? - Yes, it is affecting all GUI testing/automation tools not only AutoIt, Sikuli, ... to a certain degree every GUI testing/automation tool needs the operation system and if the operation system does not want to do anything then no tool will help you - If you need a GUI then you are NOT allowed to use a minimized or locked session. It is as simple as that. And there are many workarounds via VMs etc., see the FAQ I linked.

    – quant
    Nov 14 '18 at 12:09












  • @ArtiChetwani How about Python encoding to open the window and send controls to Save As dialog? - This will not work either. It may be that "sending the control" is already affected.

    – quant
    Nov 14 '18 at 12:12











  • @ArtiChetwani Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt. ... Yes, I didn't say that the operation system fully prevents any GUI related operations. However you are not sure which of them it will get "blocked". So if you're executing your script 100 times, it may be that it fails only 1% of the time or 99% of the time. However there are certain operations which are more likely to fail then others.

    – quant
    Nov 14 '18 at 12:14


















0














You could try running tscon.exe RDP-Tcp#0 /dest:console as admin as mentioned here. This will disconnect your RDP connection but should leave all GUI programs running normally on the VM. I have personally used this with autoit on a VM and it worked OK. Of course you will not be able to monitor your script as it runs so this may or may not work for you.






share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53297770%2fautomation-scripts-fail-when-rdpvm-is-minimized%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    The reason why your script fails when it gets executed over a minimized RDP session is quite simple. GUI automation/testing tools need to have an unlocked, active desktop - otherwise the operation system thinks that it doesn't need to actually render GUI operations (which is time consuming) since there no user can that can see the rendered graphical user interface anyway. And programs don't communicate via GUIs normally ...



    This is why QF-Test and other GUI automation/testing tools often have a note in their FAQs describing this kind of problem. For example FAQ 14 in the case of QF-Test, see https://www.qfs.de/qf-test-handbuch/lc/manual-en-faq.html



    As described in the FAQ 14 on Windows 10 or Windows Server 2016 and in case of an RDP connection you need to modify the Registry. Go to



    HKEY_CURRENT_USERSoftwareMicrosoftTerminal Server Client


    and add a new value



    RemoteDesktop_SuppressWhenMinimized as DWORD having the value 2


    After restarting you will then be able to minimize the RDP connections. However disconnecing or closing the RDP connection will probably still result in a failure.






    share|improve this answer























    • Thanks I do agree, But is this behavior also expected with tools AutoIT and Sikuli as well? How about Python encoding to open the window and send controls to Save As dialog?

      – Arti Chetwani
      Nov 14 '18 at 11:30











    • Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt.

      – Arti Chetwani
      Nov 14 '18 at 11:33











    • @ArtiChetwani But is this behavior also expected with tools AutoIT and Sikuli as well? - Yes, it is affecting all GUI testing/automation tools not only AutoIt, Sikuli, ... to a certain degree every GUI testing/automation tool needs the operation system and if the operation system does not want to do anything then no tool will help you - If you need a GUI then you are NOT allowed to use a minimized or locked session. It is as simple as that. And there are many workarounds via VMs etc., see the FAQ I linked.

      – quant
      Nov 14 '18 at 12:09












    • @ArtiChetwani How about Python encoding to open the window and send controls to Save As dialog? - This will not work either. It may be that "sending the control" is already affected.

      – quant
      Nov 14 '18 at 12:12











    • @ArtiChetwani Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt. ... Yes, I didn't say that the operation system fully prevents any GUI related operations. However you are not sure which of them it will get "blocked". So if you're executing your script 100 times, it may be that it fails only 1% of the time or 99% of the time. However there are certain operations which are more likely to fail then others.

      – quant
      Nov 14 '18 at 12:14















    2














    The reason why your script fails when it gets executed over a minimized RDP session is quite simple. GUI automation/testing tools need to have an unlocked, active desktop - otherwise the operation system thinks that it doesn't need to actually render GUI operations (which is time consuming) since there no user can that can see the rendered graphical user interface anyway. And programs don't communicate via GUIs normally ...



    This is why QF-Test and other GUI automation/testing tools often have a note in their FAQs describing this kind of problem. For example FAQ 14 in the case of QF-Test, see https://www.qfs.de/qf-test-handbuch/lc/manual-en-faq.html



    As described in the FAQ 14 on Windows 10 or Windows Server 2016 and in case of an RDP connection you need to modify the Registry. Go to



    HKEY_CURRENT_USERSoftwareMicrosoftTerminal Server Client


    and add a new value



    RemoteDesktop_SuppressWhenMinimized as DWORD having the value 2


    After restarting you will then be able to minimize the RDP connections. However disconnecing or closing the RDP connection will probably still result in a failure.






    share|improve this answer























    • Thanks I do agree, But is this behavior also expected with tools AutoIT and Sikuli as well? How about Python encoding to open the window and send controls to Save As dialog?

      – Arti Chetwani
      Nov 14 '18 at 11:30











    • Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt.

      – Arti Chetwani
      Nov 14 '18 at 11:33











    • @ArtiChetwani But is this behavior also expected with tools AutoIT and Sikuli as well? - Yes, it is affecting all GUI testing/automation tools not only AutoIt, Sikuli, ... to a certain degree every GUI testing/automation tool needs the operation system and if the operation system does not want to do anything then no tool will help you - If you need a GUI then you are NOT allowed to use a minimized or locked session. It is as simple as that. And there are many workarounds via VMs etc., see the FAQ I linked.

      – quant
      Nov 14 '18 at 12:09












    • @ArtiChetwani How about Python encoding to open the window and send controls to Save As dialog? - This will not work either. It may be that "sending the control" is already affected.

      – quant
      Nov 14 '18 at 12:12











    • @ArtiChetwani Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt. ... Yes, I didn't say that the operation system fully prevents any GUI related operations. However you are not sure which of them it will get "blocked". So if you're executing your script 100 times, it may be that it fails only 1% of the time or 99% of the time. However there are certain operations which are more likely to fail then others.

      – quant
      Nov 14 '18 at 12:14













    2












    2








    2







    The reason why your script fails when it gets executed over a minimized RDP session is quite simple. GUI automation/testing tools need to have an unlocked, active desktop - otherwise the operation system thinks that it doesn't need to actually render GUI operations (which is time consuming) since there no user can that can see the rendered graphical user interface anyway. And programs don't communicate via GUIs normally ...



    This is why QF-Test and other GUI automation/testing tools often have a note in their FAQs describing this kind of problem. For example FAQ 14 in the case of QF-Test, see https://www.qfs.de/qf-test-handbuch/lc/manual-en-faq.html



    As described in the FAQ 14 on Windows 10 or Windows Server 2016 and in case of an RDP connection you need to modify the Registry. Go to



    HKEY_CURRENT_USERSoftwareMicrosoftTerminal Server Client


    and add a new value



    RemoteDesktop_SuppressWhenMinimized as DWORD having the value 2


    After restarting you will then be able to minimize the RDP connections. However disconnecing or closing the RDP connection will probably still result in a failure.






    share|improve this answer













    The reason why your script fails when it gets executed over a minimized RDP session is quite simple. GUI automation/testing tools need to have an unlocked, active desktop - otherwise the operation system thinks that it doesn't need to actually render GUI operations (which is time consuming) since there no user can that can see the rendered graphical user interface anyway. And programs don't communicate via GUIs normally ...



    This is why QF-Test and other GUI automation/testing tools often have a note in their FAQs describing this kind of problem. For example FAQ 14 in the case of QF-Test, see https://www.qfs.de/qf-test-handbuch/lc/manual-en-faq.html



    As described in the FAQ 14 on Windows 10 or Windows Server 2016 and in case of an RDP connection you need to modify the Registry. Go to



    HKEY_CURRENT_USERSoftwareMicrosoftTerminal Server Client


    and add a new value



    RemoteDesktop_SuppressWhenMinimized as DWORD having the value 2


    After restarting you will then be able to minimize the RDP connections. However disconnecing or closing the RDP connection will probably still result in a failure.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Nov 14 '18 at 11:00









    quantquant

    1,60711527




    1,60711527












    • Thanks I do agree, But is this behavior also expected with tools AutoIT and Sikuli as well? How about Python encoding to open the window and send controls to Save As dialog?

      – Arti Chetwani
      Nov 14 '18 at 11:30











    • Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt.

      – Arti Chetwani
      Nov 14 '18 at 11:33











    • @ArtiChetwani But is this behavior also expected with tools AutoIT and Sikuli as well? - Yes, it is affecting all GUI testing/automation tools not only AutoIt, Sikuli, ... to a certain degree every GUI testing/automation tool needs the operation system and if the operation system does not want to do anything then no tool will help you - If you need a GUI then you are NOT allowed to use a minimized or locked session. It is as simple as that. And there are many workarounds via VMs etc., see the FAQ I linked.

      – quant
      Nov 14 '18 at 12:09












    • @ArtiChetwani How about Python encoding to open the window and send controls to Save As dialog? - This will not work either. It may be that "sending the control" is already affected.

      – quant
      Nov 14 '18 at 12:12











    • @ArtiChetwani Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt. ... Yes, I didn't say that the operation system fully prevents any GUI related operations. However you are not sure which of them it will get "blocked". So if you're executing your script 100 times, it may be that it fails only 1% of the time or 99% of the time. However there are certain operations which are more likely to fail then others.

      – quant
      Nov 14 '18 at 12:14

















    • Thanks I do agree, But is this behavior also expected with tools AutoIT and Sikuli as well? How about Python encoding to open the window and send controls to Save As dialog?

      – Arti Chetwani
      Nov 14 '18 at 11:30











    • Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt.

      – Arti Chetwani
      Nov 14 '18 at 11:33











    • @ArtiChetwani But is this behavior also expected with tools AutoIT and Sikuli as well? - Yes, it is affecting all GUI testing/automation tools not only AutoIt, Sikuli, ... to a certain degree every GUI testing/automation tool needs the operation system and if the operation system does not want to do anything then no tool will help you - If you need a GUI then you are NOT allowed to use a minimized or locked session. It is as simple as that. And there are many workarounds via VMs etc., see the FAQ I linked.

      – quant
      Nov 14 '18 at 12:09












    • @ArtiChetwani How about Python encoding to open the window and send controls to Save As dialog? - This will not work either. It may be that "sending the control" is already affected.

      – quant
      Nov 14 '18 at 12:12











    • @ArtiChetwani Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt. ... Yes, I didn't say that the operation system fully prevents any GUI related operations. However you are not sure which of them it will get "blocked". So if you're executing your script 100 times, it may be that it fails only 1% of the time or 99% of the time. However there are certain operations which are more likely to fail then others.

      – quant
      Nov 14 '18 at 12:14
















    Thanks I do agree, But is this behavior also expected with tools AutoIT and Sikuli as well? How about Python encoding to open the window and send controls to Save As dialog?

    – Arti Chetwani
    Nov 14 '18 at 11:30





    Thanks I do agree, But is this behavior also expected with tools AutoIT and Sikuli as well? How about Python encoding to open the window and send controls to Save As dialog?

    – Arti Chetwani
    Nov 14 '18 at 11:30













    Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt.

    – Arti Chetwani
    Nov 14 '18 at 11:33





    Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt.

    – Arti Chetwani
    Nov 14 '18 at 11:33













    @ArtiChetwani But is this behavior also expected with tools AutoIT and Sikuli as well? - Yes, it is affecting all GUI testing/automation tools not only AutoIt, Sikuli, ... to a certain degree every GUI testing/automation tool needs the operation system and if the operation system does not want to do anything then no tool will help you - If you need a GUI then you are NOT allowed to use a minimized or locked session. It is as simple as that. And there are many workarounds via VMs etc., see the FAQ I linked.

    – quant
    Nov 14 '18 at 12:09






    @ArtiChetwani But is this behavior also expected with tools AutoIT and Sikuli as well? - Yes, it is affecting all GUI testing/automation tools not only AutoIt, Sikuli, ... to a certain degree every GUI testing/automation tool needs the operation system and if the operation system does not want to do anything then no tool will help you - If you need a GUI then you are NOT allowed to use a minimized or locked session. It is as simple as that. And there are many workarounds via VMs etc., see the FAQ I linked.

    – quant
    Nov 14 '18 at 12:09














    @ArtiChetwani How about Python encoding to open the window and send controls to Save As dialog? - This will not work either. It may be that "sending the control" is already affected.

    – quant
    Nov 14 '18 at 12:12





    @ArtiChetwani How about Python encoding to open the window and send controls to Save As dialog? - This will not work either. It may be that "sending the control" is already affected.

    – quant
    Nov 14 '18 at 12:12













    @ArtiChetwani Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt. ... Yes, I didn't say that the operation system fully prevents any GUI related operations. However you are not sure which of them it will get "blocked". So if you're executing your script 100 times, it may be that it fails only 1% of the time or 99% of the time. However there are certain operations which are more likely to fail then others.

    – quant
    Nov 14 '18 at 12:14





    @ArtiChetwani Also I would like to mention that some of my scripts do work in minimized mode, I am facing issues only with this Window Based GUI component 'Save As' dialog which is automated using AutoIt. ... Yes, I didn't say that the operation system fully prevents any GUI related operations. However you are not sure which of them it will get "blocked". So if you're executing your script 100 times, it may be that it fails only 1% of the time or 99% of the time. However there are certain operations which are more likely to fail then others.

    – quant
    Nov 14 '18 at 12:14













    0














    You could try running tscon.exe RDP-Tcp#0 /dest:console as admin as mentioned here. This will disconnect your RDP connection but should leave all GUI programs running normally on the VM. I have personally used this with autoit on a VM and it worked OK. Of course you will not be able to monitor your script as it runs so this may or may not work for you.






    share|improve this answer





























      0














      You could try running tscon.exe RDP-Tcp#0 /dest:console as admin as mentioned here. This will disconnect your RDP connection but should leave all GUI programs running normally on the VM. I have personally used this with autoit on a VM and it worked OK. Of course you will not be able to monitor your script as it runs so this may or may not work for you.






      share|improve this answer



























        0












        0








        0







        You could try running tscon.exe RDP-Tcp#0 /dest:console as admin as mentioned here. This will disconnect your RDP connection but should leave all GUI programs running normally on the VM. I have personally used this with autoit on a VM and it worked OK. Of course you will not be able to monitor your script as it runs so this may or may not work for you.






        share|improve this answer















        You could try running tscon.exe RDP-Tcp#0 /dest:console as admin as mentioned here. This will disconnect your RDP connection but should leave all GUI programs running normally on the VM. I have personally used this with autoit on a VM and it worked OK. Of course you will not be able to monitor your script as it runs so this may or may not work for you.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 14 '18 at 17:55

























        answered Nov 14 '18 at 17:50









        garbbgarbb

        44837




        44837



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53297770%2fautomation-scripts-fail-when-rdpvm-is-minimized%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo