Coded ui playback via labs (kicked off from MTM), how do you set the screen resolution of the active desktop session? - coded-ui-tests

I've setup labs in such a way that the agent account automatically logs in, this means I no longer need an rdc session. The problem is that the screen resolution is 800x600 during playback.
How can I adjust this to a more realistic resolution?

Short answer is : You can't.
Coded ui tests are designed to run in "console mode", they take the native desktop resolution of the machine in "console mode" - unless there is an active RDP session open that corresponds to the "Run interactively" user account, in this case it runs on that RDP session at the resolution of the session.
So to be totally automated you would need to create Agents and set their resolution individually.

Related

Launching apps before user log in with GNOME

Is it technically possible to launch a desktop app on Gnome (Fedora or any other RHEL based distro) without being forced to log in first into the user session?
I need to boot a desktop software on system start even if there is no user to log in at that moment. Setting the account to automatically log in is of course an option but highly insecure to leave a system in that state.
You may be able to run the software in the session that runs GDM. However, I'd suggest considering some alternatives.
What about running a VNC session (Fedora includes tigervnc), and running the app inside that? You could set up some dummy user account to do this, and have this happen automatically through either a systemd unit or maybe an #reboot crontab entry.

How do I get a camera to work on an Azure Virtual Machine

I want to be able to use a camera on an Azure Virtual Machine using Windows 10.
Camera feed can either come through on local machine or a feed from another machine. Either way I get the below error:
We can't find your camera, NoCamerasAreAttached.
Even though I have enabled both through the connection and enable USB Redirection in Windows 10. incl gpedit.msc
the easiest solution I discovered is that you can go to the settings of Remote desktop connection in the general tab, go to the connection setting and select your RDP file of azure VM:
Second, in the RDP setting go to the local resource and then go to the local device tab in setting and click on the 'more' button:
Enable both checkpoints inside the video catalog that include the webcam option:
goog luck! hope it saves your day!
#syedasadrazadevops
First of all, make sure you have enabled devices redirection in the Remote Desktop connection via MSTSC. And check if you have enabled USB Redirection in both sides of the client and VM via GPEDIT. For more details, Refer to this case.

Can you think of a reason why windows might not enable audio if noone is logged in?

I'm having a bizarre problem with some virtual servers created to record podcasts. They run on amazon AWS as windows server 2012 instances and a small c# app tells FFMPEG to do the heavy lifting of capturing from the virtual screen and reading from the virtual sound card (Virtual Audio Cable: https://en.wikipedia.org/wiki/Virtual_Audio_Cable) via DirectShow filters
The problem I have is if I leave the machine to do its stuff unattended, the recordings are sometimes silent. If I log in via VNC and watch it doing its stuff the audio is recorded just fine. All other aspects of the test op are the same, and the virtual machine is shut down between successive recordings so each one should theoretically be a clean slate. The app runs under a logged in session (hence the use of VNC rather than RDP)
I'm now wondering if there is some optimisation of the windows sound engine whereby it doesn't bother playing audio if it thinks noone is listening. The confusing thing to me is that not every virtual machine suffers these problems; some of them record fine (and they're all created from the same seed virtual hard disk image) in unattended mode
I'm asking this question with the aim of getting together a list of things I can check/look into/debug.. I don't have much knowledge of how MME/DirectSound/WASAPI work internally...

restart via code on windows 10 uwp

We've created a Windows 10 application that runs on tablets in Windows 10 kiosk mode. It works just fine, however, the wifi connection gets lost sometimes since the locations are very remote. We tried fixing the issue from the networking side, but when the devices lose and regain internet access the application will still hang as if it doesn't have internet access displaying a blank page. Where these devices are used, they are bolted into the wall to prevent theft. Which means if we want to reboot its very time consuming as we have to unscrew the cases off the wall and then open the cases to gain access to the power button, and the only way to get the application to run successfully again is to do a reboot on the device.
It was suggested that we have a way to perform a reboot from the application, however, every code example I've tried doesn't work in Windows 10 UWP. Here is the most common one I've found:
System.Diagnostics.Process.Start("restart", "/r");
I have access to the namespace
System.Diagnostics
but the Process class does not exist. Anyone have suggestions on rebooting via code on Win 10 UWP? Or a better solution to our issue? Thanks in advance.
It's also worth mentioning I tried execute a Powershell command too and the dll I need to reference for the Powershell class is not compatible with UWP.
What you require is not possible with the APIs available to UWP apps. This was a security decision. An app distributed through the store shouldn't be able to do things like restart machines.
Based on your scenario though you shouldn't need to go through the store. This means that you could PInvoke native code to do whatever you want. This would still need to be initiated on the actual device.
Yes you can do that!
You should add IoT System Administration in App capability declarations:
<Capabilities><iot:Capability Name="systemManagement"/></Capabilities>
and also You need to have "Windows IoT Extension for UWP" added to your project
using this for Shutdown
Windows.System.ShutdownManager.BeginShutdown(Windows.System.ShutdownKind.Shutdown, TimeSpan.FromSeconds(1)); //Delay is not relevant to shutdown
or for Restart
Windows.System.ShutdownManager.BeginShutdown(Windows.System.ShutdownKind.Restart, TimeSpan.FromSeconds(1)); //Delay before restart after shutdown
You can get more information in this Link

How to start a gtk application after booting up without logging in?

I have got a gtk application. I want it to start automatically when I boot up the system, such that instead of getting usual login screen, my application greets the user.
My application is a sort of cash dispensing application. So user should not even see the login screen of linux. Whenever machine in boot up, after loading services and all that, my application should appear on the screen. One should not have to put any password or login in anyway to start that application.
Now so far I have tried the following but all in vain.
I put the command in my /etc/rc.local file
/home/EXE/cashier
Then rebooted machine in run level 5. But nothing happens. I get the usual login screen. Other programs that do not involve any gui or gtk, they are automatically started in this manner but not the gtk application.
Then I put
xint /home/EXE/cahier
and later
xint /home/EXE/./cashier
But they too didn't work. When I looked into details, I found out that "An Xserver is already running on screen 0, cannot open other server" or something like that.
Then I tried booting into run level 3, this time it worked.
xint /home/EXE/.cachier
But in run level 3, the font and icon sizes are smaller. Moreover some windows do not cover the whole screen.
Now I will really appreciate a way to run my application in run level 5, without showing login screen automatically.
Regards
Edit
Currently, the application is running on fedora core 2
This is more a question about linux distribution startup than it is about Gtk applications. The specifics are going to depend on your distribution, but the essence is:
Disable the gdm facility, which is normally responsible for spawning your X server.
Run xinit (not "xint") to start the server manually. This takes a client as its argument. It may work to run your Gtk application directly (it needs to be smart enough to position and size itself instead of relying on a window manager), but more likely you will want to pick a window manager to run it in. The easiest way to do this is via script that you pass to xinit.

Resources