Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String takeSnapshot(String seleniumTestId) throws UnirestException {
- /*
- * Takes a snapshot of the screen for the specified test.
- * The output of this function can be used as a parameter for setDescription()
- */
- HttpResponse<JsonNode> response = Unirest.post("http://crossbrowsertesting.com/api/v3/selenium/{seleniumTestId}/snapshots")
- .basicAuth(username, authkey)
- .routeParam("seleniumTestId", seleniumTestId)
- .asJson();
- // grab out the snapshot "hash" from the response
- String snapshotHash = (String) response.getBody().getObject().get("hash");
- return snapshotHash;
- }
Add Comment
Please, Sign In to add comment