I have a Selenium Grid configured with its hub and nodes(VMs) started automatically as Windows services. Sometimes I would like to visually inspect how a test runs within a browser on a specific node but nothing actually appears on the screen. After some research the reason seem to be that Windows services run in Session 0 which is a special session where Windows services run in isolation.
My question is whether there any way to start Windows service outside Session 0 so I will be able to see the actual test?
P.S. I am using Windows 7 on all machines.
Session 0 is the problem when you want to run your selenium grid using task-scheduler and services.
I handle this by first creating .bat file for hub,node and then running that .bat using .vbs in background.
.Vbs will help you run the setup in background in same user session but running the .vbs in startup is challenge.
Batch script.
hub.bat
java -jar selenium-server-standalone-3.14.0.jar -role hub
hub.vbs
createobject("WScript.Shell").run "hub.bat",false
Create same setup .vbs and batch for your nodes.
for Session-0 Insight refer my ans
Related
I created a Windows instance on AWS EC2 with T2 Micro, where I set up a schedule job that calls a .bat file at 6 every morning.
The .bat job invokes a few other scripts that mainly carry out some Internet-related transactions, including launching browsers, call services and perform I/O operations.
The issue is in most of the time the .bat file is not able to complete its job (Sometimes it does, but pretty rare). Later on, if I connect to the EC2 instance via remote desktop with the same username and manually call that .bat file, everything works fine.
Anyone has ever experienced this kind of problem and what is the resolution?
Thank you.
It's a common problem with automation. Some of the things you're doing such as "launching browsers" may not work for unattended execution.
A good example is Selenium, if you want to run web tests unattended then you need the headless version of Selenium, here's how to set it up for Headless:
Running Selenium with Headless Chrome Webdriver
In Microsoft Release Management 2013, in the Powershell Executor step we have configured a step to trigger a Windows batch file. This batch file will be executed on a different server, which also happens be our App Server. As an experiment, we have a simple test case to open IE, access the Google homepage URL and close the browser, a screenshot will also be captured. When we run the job from RM, the Selenium logs say that the browser is launched and the test was successful. But when we check the screenshot it is just a black screen. All this runs as the Windows service account user which is the same user that is running RM. This user has no log on privilege.
If I log into the App server with my own ID and execute the batch file manually, the screen shot is captured correctly.
I have read several online posts regarding the black screen. People have said that the screenshot is black because the screen is locked. Does this mean the RM Powershell executor step must be executed with some other credentials instead of service account? If yes, how do we do this? In some suggestions it was mentioned to install VNC. Is that relevant in this situation?
I'm fairly new to Windows. I've mostly been working in Linux systems and I've been requested to debug this issue here. Any pointers/guidance will be appreciated. Thank you!
The deployment agent does not run as an interactive service. You're going to have a lot of trouble getting it to directly invoke Selenium tests. I wrote a blog post a few years ago showing how I accomplished it. Basically, you use Selenium hub to execute the tests interactively from agent machines.
We finally got this to work.
We were invoking the testNG selenium tests within a batch script. This script was specified in RM within the Powershell Executor task. The main point to note is that, in the Powershell executor task, we must first have a cd (change directory) command to change into the directory where the Selenium scripts are. Then specify the complete path to the batch script to be executed in the same Powershell executor task. This cd command is very important. Without this, the batch script would be executed but the selenium step within that wouldn't work. You would just get a vague "configuration errors:1" in the final output.
We took care of website authentication using AutoIT for IE browser.
I have a need for starting an .exe program in multiple windows sessions (15) on the same server, whenever the server reboots.
I had a code that used to do that at start-up, but we lost that.
The exe file collects data from a bunch of servers. It needs to be run in multiple windows sessions--I think this way the process works in parallel.
Does anyone know a way to achieve this?
PsExec is a tool primarily used for running code on other servers, but can be pointed at the local machine too. The -i option can specify a session:
Run the program so that it interacts with the desktop of the specified
session on the remote system. If no session is specified the process runs in the console session.
I have written and compiled an AutoIT script ("BiconNET.exe") which interacts with the user when double-clicked. While running, the taskmanager lists the program as an App.
Now, I would like to remotely start BiconNET.exe. So I installed and configured openSSH, Cygwin and Putty. Server and client run on Windows 8.1.
I create the SSH-connection using the windows login credentials from the server. I start BiconNET.exe through the Putty conmmandline and I see instantly BiconNET.exe pop up as a service in the taskmanager of the server. But no user interaction follows. The service remains silent, and BiconNET.exe doesn't do any of the tasks its supposed to do. What is wrong here?
I guess I need to achieve that BiconNET.exe runs as an App, not as a service!?
This is what I tried so far:
I tried a workaround using a batchfile, but same issue here: Doubleclicking the batch-file on the Server works fine (BiconNET.exe interacts with the user as wished), but running it through Putty BiconNET.exe gets listed as a service, not doing anything.
I also tried to auto-elevate the batch file using this code. No luck.
I excluded BiconNET.exe from the "Data Execution Protection" (DEP) in the advanced system properties of the server. Makes no difference
I would like to understand where the problem comes from, and how to solve it. Thanks for helping.
I have an program which I need to run on multiple PCs (>100) all in same domain and share the same user and password.
If I run a program manually, it opens a console windows where I can see the logs running. I can remote desktop and still be able to see the console windows open and logs running. It helps in debugging as I can see whats going on. Issue is I want to avoid running it manually on all PCs.
I have following requirement
a. It should be able to run program on multiple pcs remotely
b. program should open in foreground where console logs can be seen.
c. launching PC should launch program on PC1 and then (without wait for the program to finish on PC1) it should launch the program on PC2 and so on.
I explored STAF it needs to be installed on all stations. Its heavyweight, needs complex configuration.
I explored power shell , it needs to be enabled on all stations and also probably (read somewhere) has issue with running tasks in foreground.
psexec can run the program but it does it in background, if I use -i option I need to give session id so only it will show the console for a specific remote desktop session. Another major issue with -i is that it will interactive so it waits until the program exits.
Looked a paexe, its simillar to psexe and doesn't solve the issue I am facing with psexe.
Any help is greatly appreciated.
If you have a server, you can put the program on the server and create a shortcut to it (assuming the program is small/simple enough to run on a network share).
You can use One-Click to deploy the programs, and give each of your users a link.
You can change the program into a website for central access.
You can use group policy to deploy the program when a user logs in, assuming you can create a .msi file from it.