Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to automate BrowserStack screenshot API on my localhost?

I tried to go through their Screenshots API & Local testing but got lost in between.. All I want is to test my front-end style guide (language agnostic), can someone direct me to a good direction please?

like image 895
ivanasetiawan Avatar asked Mar 22 '26 00:03

ivanasetiawan


1 Answers

Generating screenshots for internal URL via Screenshots API is a two-step process:

a) Setup Local Testing using the BrowserStack Local binary. The command is as follows: ./BrowserStackLocal --key KEY More details on Local Testing is available here.

b) Add the parameter "local" = true in your Rest API. For more information, refer.

Example for generating a screenshot for localhost on Windows 7-IE 8:

"UserName:KEY" -H "Content-Type: application/json" -H "Accept: application/json" -d '{"browsers": [{"os": "Windows", "os_version": "7", "browser_version": "8.0", "browser": "ie"}], "url": "http://localhost", "local": "true"}' https://www.browserstack.com/screenshots

Note: The access key for your account can be acquired from here.

like image 91
Mukesh Tiwari Avatar answered Mar 23 '26 15:03

Mukesh Tiwari



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!