do you have a java example of how to invoke the Automated Screenshots api using HttpClient?
I can't seem to get by the basic authentication.
I'm getting '401 Authorization Required'.
UsernamePasswordCredentials u =
new UsernamePasswordCredentials("some username", " some password");
CredentialsProvider creds =
new BasicCredentialsProvider();
creds.setCredentials(
new AuthScope("crossbrowsertesting.com", AuthScope.ANY_PORT),
u);
Next you would create your HttpClient like normal but you add the credential object you created above
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.setCredentialsProvider(creds);
Comments
Automated Screenshots api
do you have a java example of how to invoke the Automated Screenshots api using HttpClient?
I can't seem to get by the basic authentication.
I'm getting '401 Authorization Required'.
http client example
First you need to make a CredentialsProvider
UsernamePasswordCredentials u =
new UsernamePasswordCredentials("some username", " some password");
CredentialsProvider creds =
new BasicCredentialsProvider();
creds.setCredentials(
new AuthScope("crossbrowsertesting.com", AuthScope.ANY_PORT),
u);
Next you would create your HttpClient like normal but you add the credential object you created above
DefaultHttpClient httpclient = new DefaultHttpClient();
httpclient.setCredentialsProvider(creds);
Then you should be able to call execute
HttpResponse response = httpclient.execute(httpget);
And that should be it. The URL that you will be requesting will look something like this:
http://crossbrowsertesting.com/api/screenshots/9999/version/9999/show
You will need to change it to match your own case.