public void addBrowser ( DesiredCapabilities cap , int instances ) { String s = cap . getBrowserName ( ) ; if ( s == null || "" . equals ( s ) ) { throw new InvalidParameterException ( cap + " does seems to be a valid browser." ) ; } if ( cap . getPlatform ( ) == null ) { cap . setPlatform ( Platform . getCurrent ( ) ) ; } cap . setCapability ( RegistrationRequest . MAX_INSTANCES , instances ) ; registrationRequest . getConfiguration ( ) . capabilities . add ( cap ) ; registrationRequest . getConfiguration ( ) . fixUpCapabilities ( ) ; }
Adding the browser described by the capability automatically finding out what platform the node is launched from