Guest User

Untitled

a guest
Jan 19th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public String takeSnapshot(String seleniumTestId) throws UnirestException {
  2. /*
  3. * Takes a snapshot of the screen for the specified test.
  4. * The output of this function can be used as a parameter for setDescription()
  5. */
  6. HttpResponse<JsonNode> response = Unirest.post("http://crossbrowsertesting.com/api/v3/selenium/{seleniumTestId}/snapshots")
  7. .basicAuth(username, authkey)
  8. .routeParam("seleniumTestId", seleniumTestId)
  9. .asJson();
  10. // grab out the snapshot "hash" from the response
  11. String snapshotHash = (String) response.getBody().getObject().get("hash");
  12.  
  13. return snapshotHash;
  14. }
Add Comment
Please, Sign In to add comment