Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

UI Tests on a Grid Node
Martin
#1 Posted : Saturday, January 25, 2020 10:17:46 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/2/2013(UTC)
Posts: 2

Thanks: 1 times
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.readth...t/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
#2 Posted : Sunday, January 26, 2020 5:54:13 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,943

Thanks: 777 times
Was thanked: 998 time(s) in 951 post(s)
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.
1 user thanked Remco for this useful post.
Martin on 1/26/2020(UTC)
Martin
#3 Posted : Sunday, January 26, 2020 8:25:20 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 1/2/2013(UTC)
Posts: 2

Thanks: 1 times
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
Remco
#4 Posted : Sunday, January 26, 2020 11:37:40 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 5,943

Thanks: 777 times
Was thanked: 998 time(s) in 951 post(s)
You're welcome! Thanks for using NCrunch :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.039 seconds.