Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to replace a capability-value in the Selenium Grid before passing to a node

Can a Selenium Grid change the DesiredCaps of the SeleniumClient?

Is their a way to change the values of the Capabilities in the Selenium Grid?

I am already extending the org.openqa.grid.internal.utils.DefaultCapabilityMatcher in a java class to validate some values. Need a way to replace them as well before passing to the Nodes?

like image 642
Anshuman Chatterjee Avatar asked Sep 17 '15 08:09

Anshuman Chatterjee


1 Answers

You can build your on custom proxy to do so. In the custom proxy you need to extend the following class: org.openqa.grid.selenium.proxy.DefaultRemoteProxy and override beforeSession function which has TestSession object as a parameter, from where you can get the capabilities. While registering your node you need to specify the new proxy and start the hub with new custom proxy.

like image 75
Eldho Mathulla Avatar answered Oct 05 '22 17:10

Eldho Mathulla