Hi,
I was wondering if it is possible to execute UI Automation Tests on a Grid Node?
Having the option of running them on a grid node is really useful, as the involve opening windows and sending UI events like mouse clicks and keyboard input and are often rather slow - all of which you don't want to have on your development machine.
While UI Automation Tests work generally fine in ncrunch if they are executed on the same machine, I've not yet been successful with running them on a grid node.
For example, I when using: FlaUI (https://github.com/FlaUI/FlaUI) the call
```csharp
var window = app.GetMainWindow(automation);
```
works fine on my machine, but returns `null` when executed on a grid node.
In the past I've been able to use a combination of creating a remote desktop connection and then using an interactive process using `psexec` to automate UI Tests on a VM in the past when invoking a console test runner.
The process was similiar to what is documented here: https://pywinauto.readthedocs.io/en/latest/remote_execution.html
But with ncrunch, I am not launching the process myself using psexec, but the grid node service is, so I am not sure what I could do here.
Is there a way to get UI Automation Tests working on a Grid Node?
I've searched the forum but I didn't find anything related to that.
Thank you!
Take care,
Martin
Remco NCrunch Developer
#14395
26 Jan 2020 05:54 UTC
Hi Martin,
Yes, this is absolutely possible. Your tests are probably failing to run because by default, the grid node service installs as a background service running under the local system account.
You have a couple of options here. Firstly, you can change the logged in user for the 'NCrunch Grid Node' service under your windows configuration, and turn on the option that allows the service to interact with the desktop.
If the above doesn't work, you can try hosting the grid node using NCrunch.GridNode.Console.exe instead of the usual service wrapper. Make sure you first stop the service from running on the server's startup to avoid any listening port clashes.
Yes, this is absolutely possible. Your tests are probably failing to run because by default, the grid node service installs as a background service running under the local system account.
You have a couple of options here. Firstly, you can change the logged in user for the 'NCrunch Grid Node' service under your windows configuration, and turn on the option that allows the service to interact with the desktop.
If the above doesn't work, you can try hosting the grid node using NCrunch.GridNode.Console.exe instead of the usual service wrapper. Make sure you first stop the service from running on the server's startup to avoid any listening port clashes.
Hi Remco,
thanks a lot for your reply!
I forgot to mention that I already tried option 1 (using a logged in windows user account as ncrunch grid nodes service account and enabling the interactive session),
But option 2 is spot on! I've stopped the ncrunch service and started NCrunch.GridNode.Console.exe in my virtual machine and the tests now run successful!
Thanks a lot! I should have figured that one out myself!
Just wanted to say thanks for creating ncrunch as I am big fan and have been using it over the years.
The grid node server is also very useful to me, as I don't have the dependencies to run the code installed on my system but I can still implement it and see if it works.
Take care,
Martin
thanks a lot for your reply!
I forgot to mention that I already tried option 1 (using a logged in windows user account as ncrunch grid nodes service account and enabling the interactive session),
But option 2 is spot on! I've stopped the ncrunch service and started NCrunch.GridNode.Console.exe in my virtual machine and the tests now run successful!
Thanks a lot! I should have figured that one out myself!
Just wanted to say thanks for creating ncrunch as I am big fan and have been using it over the years.
The grid node server is also very useful to me, as I don't have the dependencies to run the code installed on my system but I can still implement it and see if it works.
Take care,
Martin
Remco NCrunch Developer
#14397
26 Jan 2020 11:37 UTC
You're welcome! Thanks for using NCrunch :)
Post a reply
Log in to reply.