Notes: This is cross-posted on SO - https://stackoverflow.com/questions/48169961/tagging-selenium-nodes-and-requesting-nodes-without-that-tag

We have an internal selenium grid that currently has 20 nodes (FF and CH) with the capacity for scaling if/when needed. All of these nodes are configured exactly the same, therefore when we run tests, we don't really care which node gets allocated.

Now we have a need to have a couple of nodes configured differently. We then need to allocate those nodes only when a test specifically requests one. So far so good - we can use capabilities to "tag" nodes and then use DesiredCapabilities to request one of these "special" nodes (e.g. we can use platform description, etc.)

The question is how do we avoid getting these nodes allocated unless specifically requested? What I am looking for is this behaviour, essentially:

  • if a specific capability is requested, then allocate one of the nodes matching that capability
  • if a specific capability is not requested, then allocate any other node other than these special ones

We need to avoid having to change existing tens of thousands of selenium tests so that the default behaviour will result in a "standard" node.

Making any changes to the node config or hub config is ok.

Of course, we can always set up a separate hub and attach these special nodes to this special hub - but that feels like an overkill to me to manage two hubs.

Any other suggestions?

  • All the nodes should be tagged, so just tag the baseline node appropriately, base/standard/normal whatever is appropriate. Jun 16, 2021 at 14:05


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.