#SauceREST Java
A Java client for Sauce Labs’s REST API. This supercedes the old [sauce-rest-api].
Using this client you can update Job info, including pass/fail status and other information supported. Only the Sauce Labs Virtual Device Cloud is supported. For Real Devices, please see the docs.
If a function you're after isn't supported, we suggest either shelling out and using the curl version, or sending a pull request! Contribution Details Here
http://saucelabs.com/docs/sauce-ondemand#alternative-annotation-methods
SauceREST sauce = new SauceREST("username", "access-key");
OR
SauceREST sauce = new SauceREST("username", "access-key", Datacenter.US);
Users generally only have access to their own jobs and resources. Parent accounts may have access to their children's jobs. Check out the Sauce Labs documentation for more information.
###Mark a job passed or failed:
sauce.jobPassed(job_id);
sauce.jobFailed(job_id);
String tunnels = sauce.getTunnels();
Assets are downloaded by providing a job ID and the location to save the asset too.
sauce.downloadLog("job_id", "/var/tmp/selenium.log");
HAR files are only available for jobs using Extended Debugging.
sauce.downloadHAR("job_id", "/var/tmp/HAR.log");
Video is only available for jobs which have not disabled video recording.
sauce.getJobInfo("job_id");
sauce.getJobInfo();
sauce.getJobInfo(n); #n is the number of jobs to retrieve, as an integer
String tunnels = sauce.getTunnels();
<dependencies>
<dependency>
<groupId>com.saucelabs</groupId>
<artifactId>saucerest</artifactId>
<version>LATEST VERSION</version>
<scope>test</scope>
</dependency>
</dependencies>
For latest version please check the following link: https://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.saucelabs%22%20AND%20a%3A%22saucerest%22
Check out our contribution guide Here.