Question

BrowserStack now offers a ScreenShot API which allows you to post a request and receive back HTML/JSON with a link to generated screen shot images stored on their server:

http://www.browserstack.com/screenshots/api

The examples are sparse, and use CURL to do all the transport.

1) What is the quick and dirty way to automate w/curl and dump these screens into a folder 2) How would one consume this request architectural in a .NET console/web app to automate this process?

This seems so new there is no documentation or examples on its usage anywhere.

An example request:

curl -u "username:password" -H "Accept: application/json" -d 'data={"browsers": [{"os": "Windows", "os_version": "7", "browser_version": "8.0", "browser": "ie"}], "url": "http://google.com"}' http://www.browserstack.com/screenshots

And the response:

Response {
  "job_id":"13b93a14db22872fcb5fd1c86b730a51197db319",
  "callback_url": "http://staging.example.com",
  "win_res": "1024x768",
  "mac_res": "1920x1080",
  "quality": "compressed",
  "screenshots": [{
    "os":"Windows",
    "os_version":"XP",
    "browser":"ie",
    "id":"be9989892cbba9b9edc2c95f403050aa4996ac6a",
    "state":"pending",
    "browser_version":"7.0",
    "url":"www.google.com"
  },
  {
    "os":"Windows",
    "os_version":"7",
    "browser":"ie",
    "id":"1f3a6054e09592e239e9ea79c247b077e68d3d71",
    "state":"pending",
    "browser_version":"8.0",
    "url":"www.google.com"
  }
    ....
  ]
}

Get status of screenshots in queue

Usage GET /screenshots/<JOB-ID>.json

etc.

Était-ce utile?

La solution

The answer to this is to use CURL and read the CURL help files and find a good GUI tool (duh).

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top