Keep Edge running while Windows Server 2019 remote session is locked - microsoft-edge

I want to execute ServiceNow Automated Tests, which requires a browser session to be connected to the instance.
As our tests run for about 15 hours, I've ordered a virtual Windows Server 2019 running a Microsoft Edge browser.
I noticed that the tests stopped being executed after the screen was locked.
How can I force Microsoft Edge to continue to run whilst the screen is locked?

Related

How to emulate screen on Windows VM in GCP for Electron app screenshare test?

Setup:
test framework around latest WebdriverIO v.7
Jenkins on GCP: master - Ubuntu, slave - Windows Server 2022 VM.
connection between Jenkins master and slave is done with GCP jenkins plugin, so Windows slave is being created for test and then dies.
app under test: Electron v14.2.1 based app.
Test - "User can start screenshare"
User start a call.
User select an available screen and start a screenshare.
Problem:
Electron library can not detect available screen for capturing and sreensharing, because there is no RDP connection opened in test session.
In test logs no sources (screen) found:
2022-08-01 07:40:20:409 -00:00 | info | main-api-handler: - open-screen-picker-window - Properties: {
"cmd": "open-screen-picker-window",
"id": 1,
"sources": []
}
Questions:
How can the screen be emulated?
Where the RDP should be established? Should it?
Are there other way than RDP to provide the screen for the Electron app?
The problem was solved by my colleague:
"So the root cause of this issue is that the SSH server which Jenkins uses to configure the node runs as a service, and that means it has problems interacting with desktop apps. Unfortunately, Windows' own SSH server only runs as a service. More explanations here: Starting GUI programs via OpenSSH on Windows?
To resolve this, I installed a separate SSH server (OpenSSH from MSYS2). The machine image is configured to autologin on boot, and sshd is started on logon as the currently logged in user. This gives it access to the desktop, and screenshare tests now seem to work better"

Windows Service does not start automatically on Windows 7

I made a Windows Service application, set its properties to start automatically, using system account.
Windows 10 behavior: Starts as expected. On every system restart.
Windows 7 behavior: Does not start. No error / warning message in any log. Can be started by administrative user. Starts immediately.
I would understand an error occurs when the system is trying to start the service, but then again where's the log entry? Why the service can be started manually? Then, what's the weirdest part here: why does it work on Windows 10?
BTW, my service's OnStart is empty except base.OnStart(args).
The only log entry I get is System log:
A timeout was reached (30000 milliseconds) while waiting for the MY_SERVICE to connect.
Important fact: The service starts when set to "Delayed Start". But this is not acceptable for me. The service is to be started ASAP, "Delayed Start" occurs way too late for my needs.
How to make my service compatible with Windows 7, what may be the possible cause of service not starting automatically on Windows 7, but staring correctly on Windows 10?
My service uses .NET Framework 4.6.1 and it is installed on my test Windows 7 VM.

Automation engine is unable to playback the test because it is not able to interact with the desktop

I am trying to run Coded UI tests and I get this message. This happens only if I disconnect from the remote session or I have it minimized.
I enabled autologon, the agent is running in interactive mode, disabled screen saver and lock screen but still not working.
What should I try next?
You need to not connect visa remote desktop. Connect once and reboot the machine and do not connect.
Every time you RDP to the test box you need to reset it by rebooting.
Reason: The reason for this is that starting a remote desktop session suspends the local desktop session that the agent needs in order to run tests

Performance monitoring of production site using Shell script and Selenium Web Drivers

I will shortly try to explain what I am trying to do here. I need to periodically check the response time of the my site by logging into the system and noting the time to load the welcome page.
I am doing this using Selenium WebDriver and Java. I am currently checking the response time using the org.apache.commons.lang3.time.StopWatch which start when user hits the login button and stops when welcome page renders completely. I check weather this response time is above threshold level and send mail to admin alerting him in case of slow response of system.
Currently, I have created the executable jar file which opens the web browser using Selenium WebDriver and check the response time. I have also created the job in Jenkins using DOS commands which runs periodically using cron schedular. This I'm doing in my Windows 7 pc and I have Jenkins installed on my localhost. The scheduled job builds on Jenkins periodically but I can't see any activity like opening the web browser and the further task explained above. It runs perfectly when I use windows scheduler to execute batch file. The ultimate goal I have, is to run the Selenium WebDriver tests on the Linux system via jenkins while Jenkins server has been installed on a Linux machine.
Any help will be great! Also let me know if anybody wants to see the code.

Viewing Selenium Scripts in Jenkins Server

I am using Jenking to run my selenium scripts on a remote server. My question is "Is there any way to visually see my scripts running on the server? I mean on an actual browser when scripts are running in Jenkins?"
No, you cannot visually see a browser running on ubuntu server but apart from that you can run a headless browser and log everything to see the progress of your scripts running on server.
Yes, either use a Sauce labs account, or just run tightVNC server on the remote system, which runs a vnc server in a "Java Viewer" and by setting a "readonly password" to the server, you can open a browser and using the java viewer, basically you can watch the session and you can even "scale" the size of the desktop just like Sauce Labs can do.

Resources