Skip to content

Example that shows how to implement a custom capability matcher for Selenium Grid

Notifications You must be signed in to change notification settings

diemol/custom-capability-matcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Custom Capability Matcher

Example that shows how to implement a Selenium Grid capability matcher, implementation of a tutorial that can be found here.

How to generate the jar

It will be placed in the target folder

    $ mvn -DskipTests=true package

Steps to start the grid

  1. Download Selenium Server
  $ wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar
  1. Start the hub with a the specific configuration
  $ java -cp selenium-server-standalone-2.53.0.jar:target/custom-capability-matcher-1.0-SNAPSHOT.jar org.openqa.grid.selenium.GridLauncher -role hub -hubConfig src/main/resources/hubConfig.json
  1. Start the foo node
  $ java -jar selenium-server-standalone-2.53.0.jar -role node -hub http://localhost:4444/grid/register -nodeConfig src/main/resources/nodeConfig_foo.json
  1. Start the bar node
  $ java -jar selenium-server-standalone-2.53.0.jar -role node -hub http://localhost:4444/grid/register -nodeConfig src/main/resources/nodeConfig_bar.json

Run the test

  $ mvn test

Change this line to see the matcher in action by:

  • Either setting nodeName capability to foo or bar and see the test getting executed in the desired node.
  • Removing the nodeName capability and letting the DefaultCapabilityMatcher decide.
  • Or setting nodeName to a different value and seeing the Grid reject the request because no node matches the capabilities.

About

Example that shows how to implement a custom capability matcher for Selenium Grid

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages