Skip to content

Instantly share code, notes, and snippets.

View manjeetglv's full-sized avatar

Manjeet Lama manjeetglv

View GitHub Profile
@krmahadevan
krmahadevan / MyRemoteProxy.java
Created January 27, 2013 18:27
This is a custom Proxy. This proxy when injected into the Grid, starts counting unique test sessions. After "n" test sessions, the proxy unhooks the node gracefully from the grid and self terminates gracefully. The number of unique sessions is controlled via a properties file : "mygrid.properties".
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.openqa.grid.common.RegistrationRequest;
import org.openqa.grid.internal.Registry;