protected static void addAdditionalDesiredCapabilities ( Selenified clazz , ITestContext context , String capabilityName , Object capabilityValue ) { DesiredCapabilities desiredCapabilities = new DesiredCapabilities ( ) ; if ( context . getAttributeNames ( ) . contains ( clazz . getClass ( ) . getName ( ) + DESIRED_CAPABILITIES ) ) { desiredCapabilities = ( DesiredCapabilities ) context . getAttribute ( clazz . getClass ( ) . getName ( ) + DESIRED_CAPABILITIES ) ; } desiredCapabilities . setCapability ( capabilityName , capabilityValue ) ; context . setAttribute ( clazz . getClass ( ) . getName ( ) + DESIRED_CAPABILITIES , desiredCapabilities ) ; }
Sets any additional capabilities desired for the browsers . Things like enabling javascript accepting insecure certs . etc can all be added here on a per test class basis .