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

Notification

Icon
Error

Setting an Environment Parameter all grid nodes pick up
Phonesis
#1 Posted : Wednesday, August 17, 2016 1:42:53 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 4/14/2016(UTC)
Posts: 32
Location: United Kingdom

Was thanked: 3 time(s) in 3 post(s)
Hi Remco,

We use TeamCity to run an NCrunch grid / distributed processing setup where a single controller machine sends jobs off to the grid nodes.

We use Selenium as these are all web UI tests.

The code in our solution checks for the existence of an environment variable for the Browser choice. This will be "Chrome", or InternetExplorer", etc.

The env var is set via TeamCity using the in built feature of setting the variable on the build agent before the run kicks off.

The problem is the env var doesn't make it as far as the grid nodes, only the controller. The result is the browser is always just Chrome (our default one).

I saw this: https://www.ncrunch.net/...m-environment-variables

Could this be utilised somehow? We are unsure how we go about implementing it.
Remco
#2 Posted : Wednesday, August 17, 2016 7:55:01 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1287 time(s) in 1194 post(s)
Hi, thanks for posting!

The environment variables are intended to be hard-coded to a grid client, and they are then present on any node that is doing work for this client. As such, if you are using this exclusively on your build server, it might be possible to create a custom NCrunch config file for each environment variable setup, then feed this into the console tool for alternative runs. So you would basically have several globalconfig.crunch.xml files, each containing a different environment variable targeting a different browser.

In theory, this would give you want you want, though it would only really be useful for the NCrunch console tool (not so much for the VS client).
Phonesis
#3 Posted : Thursday, August 18, 2016 9:37:51 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 4/14/2016(UTC)
Posts: 32
Location: United Kingdom

Was thanked: 3 time(s) in 3 post(s)
Remco;9111 wrote:
Hi, thanks for posting!

The environment variables are intended to be hard-coded to a grid client, and they are then present on any node that is doing work for this client. As such, if you are using this exclusively on your build server, it might be possible to create a custom NCrunch config file for each environment variable setup, then feed this into the console tool for alternative runs. So you would basically have several globalconfig.crunch.xml files, each containing a different environment variable targeting a different browser.

In theory, this would give you want you want, though it would only really be useful for the NCrunch console tool (not so much for the VS client).



Thanks Remco. We've ended up using a text file on a shared drive with a Browser value stored in it. The code checks for the value on setup and each grid node can access it. It's ok for our needs!
Remco
#4 Posted : Thursday, August 18, 2016 12:08:26 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1287 time(s) in 1194 post(s)
Phonesis;9113 wrote:

Thanks Remco. We've ended up using a text file on a shared drive with a Browser value stored in it. The code checks for the value on setup and each grid node can access it. It's ok for our needs!


Brilliant! Good thinking :)
Phonesis
#5 Posted : Monday, August 22, 2016 3:41:29 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 4/14/2016(UTC)
Posts: 32
Location: United Kingdom

Was thanked: 3 time(s) in 3 post(s)
Not directly on topic but we are seriously struggling with IEDriver (the Internet Explorer Selenium driver) and our grid setup. Chrome works great. In order to debug why IEDriver isn't working (seems to load up ok but then fail to interact with page) we'd like to be able to see it running on one of the grid machines but it appears to behave headlessly. This makes it very hard to investigate. Any ideas? Can the grid service run in a sort of console mode where you can see it in action when logged into the machine?
Remco
#6 Posted : Monday, August 22, 2016 11:27:22 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1287 time(s) in 1194 post(s)
Phonesis;9130 wrote:
Not directly on topic but we are seriously struggling with IEDriver (the Internet Explorer Selenium driver) and our grid setup. Chrome works great. In order to debug why IEDriver isn't working (seems to load up ok but then fail to interact with page) we'd like to be able to see it running on one of the grid machines but it appears to behave headlessly. This makes it very hard to investigate. Any ideas? Can the grid service run in a sort of console mode where you can see it in action when logged into the machine?


There is a console front-end to the grid node service that is automatically installed with the rest of the grid node. Running NCrunch.GridNode.Console.exe will launch the service inside a console window where it can interact with the desktop under the current user account.
Phonesis
#7 Posted : Tuesday, August 23, 2016 9:36:02 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 4/14/2016(UTC)
Posts: 32
Location: United Kingdom

Was thanked: 3 time(s) in 3 post(s)
Thanks Remco. I have enabled the console mode but do not see any web driver instances running. The grid service is logged in as Local System (default setting) whereas I am logging into the grid machine on my network account. Is this why or should the console mode still work?
Remco
#8 Posted : Tuesday, August 23, 2016 9:40:32 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1287 time(s) in 1194 post(s)
The console tool itself won't show any consideration to the logged in user of the grid node service (it is a separate application entirely). It will always run under the logged in user account.

Because of the way security works under Windows, any test runner EXEs launched by the grid node console tool will be running under the same account as the console tool. This means that your tests should, in theory, be able to interact with the desktop. If you don't see any interaction, this may be because of the how the selenium driver works. Is it possible this may be running on a headless mode of some sort?
Phonesis
#9 Posted : Tuesday, August 23, 2016 10:01:26 AM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 4/14/2016(UTC)
Posts: 32
Location: United Kingdom

Was thanked: 3 time(s) in 3 post(s)
Yeah could well be doing that. I'll continue to investigate. Thanks again.
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.059 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download