About behavior of "Minimize" in case of Remote App when using Guacamole - windows

We are using Guacamole for developing an application with RDP. We did POC using code from the following GitHub repositories:
https://github.com/wwt/guac
https://github.com/wwt/guac-vue
Configuration details are:
Windows Server 2016. RDP service is running here.
With this setup, we could successfully access the application remotely, however, the "minimize" action is not behaving as we expected. That is, the remote app window vanishes when we press the "minimize" button and a black screen is shown.
We could get back to the app by pressing 'Alt+Tab' combination but what we are expecting here is that the app getting placed at the bottom of the window showing three buttons: "Minimize, Restore and Close", so that we can take the further action. (As shown below.)
Has someone come across such a scenario and was able to address the need? Any help will be highly appreciated.
We came across this thread that talks about a similar problem but it doesn't have a solution.
We also explored official documentation of guacamole but had no luck.
Thanks in advance!

I believe you are starting the application using RemoteApp mechanism. The RemoteApp means that the remote application will be started integrated with the local computer desktop. The local computer desktop, or better window manager, will handle the minimise action.
In case of the Guacamole, the "local computer desktop" is the browser window, which does not have window manager. This means that there is no place for app to go when minimised.
You may try the Guacamole parameter "initial-program" instead of "remote-app". This parameter will launch the application immediately upon the connection is established, but the session will also have full desktop from the remote machine.

Related

Automation of a graphical app in a windows VM

I need to automate a windows only java graphical app in a cloud vm.
I'm currently trying with windwos server 2008 and robotJS in node, if I'm connected to the VM in RDP and showing the screen, all is good and it work, but it's no real automation.
If managed to launch the user session at start, and added the app and my script in the startup dire to have them launched when the user logon, but when I do that, the robot only see a black screen with the start button when I'm taking a screenshot, and it can't interact with the app.
As someone already try to do that ?
Any insight would be good, I can change the server version, use another automation tool, anything if it work.
I let that here because it might one day help someone.
The trick was to use keyboard shortcut instead of mouse, not sure why.

Running Internet Explorer on LocalSystem Account on Windows 2012

I'm setting up Selenium Grid. We have a separate machine for each version of the browser.
Each node is started as System Service running on LocalSystem account with interactions with user desktop enabled.
This is required because Selenium Grid node starting Internet Explorer have problems making screenshots and transferring them when there was no interaction with user desktop.
As far as I was able to check, it looks like that interactions with user desktop for service are only allowed for LocalSystem account. Event changing manually flags in registry does not seem to works (as it was in windows 2008)
Everything is working fine except the test where I need to perform upload of the file. When there is an action to open dialog for file browsing, following popup appears
Is there any way to prevent this (creation of folder Desktop does not seem to work) ?
From the other hand, if there is a way to run service under different account with interactions with user desktop enabled, that would also be a case.
I would appreciate any help because I'm stuck with the problem
I have checked some additional solutions, like running selenium grid nodes via PowerShell Invoke-Command and this did not worked too.
I have managed to run selenium grid nodes as Windows Service with desktop interactions using 3rd party tool FireDaemon Pro Service Manager.
I didn't try this but PsExec -s should work
https://technet.microsoft.com/en-us/sysinternals/bb897553

Is a mouse click on a remote desktop possible using AutoIt or alternatives?

I want to write a script that involves mouse click and stuff. I am little confused though. Is there a way mouse clicks (in the form of x and y co-ordinates) would work on a VPS which is logged on, but disconnected from the client?
Example:
MouseClick("left",588, 268)
To my knowledge, these VPSes don't have their own native screen resolution. I have already written the script for my local pc and it's working fine on my resolution. But when tried with the VPS, it doesn't work.
PS: I am running the script from the remote desktop itself and not from my local pc. Please correct me if there's anything I am doing wrong :)
Update: For anyone still looking for an answer, consider installing a vnc server, that way the screen resolution you specify is preserved even when not connected to the server.
Ex: https://www.realvnc.com/en/connect/download/vnc/
It's relevant to almost any automation tool, not only AutoIt.
Remote Desktop has its own GUI context only if it's connected to the remote PC. But you can lose focus for a Remote Desktop window (without disconnection & without minimizing) and continue other local work.
The same effect takes place for VNC server software.
One team in our organization uses it for massive test runs automation: a master server creates a remote session for each test machine and keeps them all connected until tests passes.
Use ControlClick to have the mouse click over RDP connections, even when you're not connected. For some reason it can still be iffy for me, but at least it worked more so that Click which was none at all.

Keep windows GUI while switching windows user or closing remote connection

I need to run a GUI script (AutoHotKey, which makes mouse clicks and press keys) on:
A different windows user (i.e. I run the script, then switch user
while keeping the session active)
A remote Amazon windows server (using remote desktop) where I also
run the script then close the Remote Desktop while keeping the
instance running
Unfortunately, in both cases, the script doesn't run as it seems that Windows enters a "GUI-less" mode where all GUI components are not active anymore.
Is there any solution to this?
Any hint would be greatly appreciated as I've now lost days trying to solve this!
Many thanks, Thomas
I do not believe this is possible due to the way Remote Desktop is implemented. When you close the RD connection, the GUI is no longer drawn. Therefore, AutoHotkey is unable to perform mouse clicks and key presses.
A possible workaround would be to make some registry tweaks (if possible on your server) which allow GUI interaction while minimized.
Locate HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
Create RemoteDesktop SuppressWhenMinimized as DWORD with a value of 2
Registry Tweak Source

Terminal session when minimized\disconnected returns a blank screen upon capturing desktop snapshot

I am using the below JAVA code to capture the desktop of a remote machine
Robot robot = new Robot();
BufferedImage screenShot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ByteArrayOutputStream imageBytes = new ByteArrayOutputStream();
ImageIO.write(screenShot, "PNG", imageBytes);
return imageBytes.toByteArray();
However the captured image is blank, when the terminal session to the remote machine is either minimized or disconnected. I appreciate your help in resolving the issue, at the very least the minimized scenario.
Configuration:
I have the same issues with a physical machine running windows 7 and a virtual machine running windows server 2008 R2.
More insights from MSDN:
Why you get black screen when you disconnect from RDP ?
 
http://msdn.microsoft.com/en-us/library/aa383015%28VS.85%29.aspx
Here is my attempt to make things work, but none of the following did the trick:
 
How to get data when RDP window minimized ?
 
You can force the RDP display driver to send data when minized, try these steps and let me know how it goes:
 
1) Add the following key
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client\ Created a new DWORD value and named it RemoteDesktop_SuppressWhenMinimized. Specified 2 as the value data.
Note: Also tried adding the registry key to HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Terminal Server Client\
 
2) Disable bitmap caching (http://technet.microsoft.com/en-us/library/cc737325(WS.10).aspx)
In the Remote Desktop Connection window, click Options.
On the Experience tab, verify that the Bitmap caching check box is selected. Or, to disable bitmap caching, clear theBitmap caching check box
If you minimize the Remote Desktop window, Windows switches the remote session to the GUI-less mode and does not display windows and controls. As a result, TestComplete (or TestExecute) will be unable to interact with the tested application’s GUI, as it does not exist and your automated GUI test will fail.
To work around the issue, you can change the Remote Desktop’s registry settings on your local computer (where you launch the Remote Desktop):
On your local computer, close all open Remote Desktop sessions.
Launch the Registry editor (regedit.exe).
Navigate to one of the following Registry keys, depending on whether you wish to modify the Remote Desktop settings only for the current user or for all users on the computer:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server Client
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server Client
Create a DWORD value named RemoteDesktop_SuppressWhenMinimized and set it to 2.
Or you can do it programmatically by following steps:
Transparent the window
Restore the Window
Capture
Minimize it again
Remove transparency
We had similar problem in our project last year...we could find any stable and permanent solution....however here is how a work around worked for us...
We had to run on 5 remote desktops (which will take screens capture as well during failure) ..however as you have figured already if we disconnect session or minimise the RDC Window blank screenshot is captured. Therefore we had added one more VM to connect those other five test boxes. The task for that VM is to keep session active and resized to other 5 boxes...this worked for us.
If you connect a remote desktop to the test machine, make sure to reboot the machine when you are done, otherwise the desktop will remain locked and screen captures will not work.
I don't believe there is any other way around the issue.
I just configured the clients to auto logon, disabled the screen saver and installed a VNC server on each client.
Basically, make sure the screen is always on, and don't RDP into them.
This worked on both physical PCs and on virtual machines hosted on a Hyper-V server.
I even wrote a small .NET desktop client that ran multiple VNC clients inside a single window, so we could see what was happening on all the clients. We had an old PC running this with it's monitor on top of a cupboard to (a) let the developers see if any client had hung, had hundreds of browser windows open, etc. and (b) to look impressive for any non-developers walking past.
A simpler alternative to the above answers to to transmute the terminal session (RDP) into the console session. The session will then display to the physical screen (Switching the user of anyone currently logged into the physical machine). The following command does this:
for /f "skip=1 tokens=3" %%s in ('query user %USERNAME%') do (tscon.exe %%s /dest:console)

Resources