Skip to content

Instantly share code, notes, and snippets.

View ashwingonsalves's full-sized avatar

Ashwin Gonsalves ashwingonsalves

View GitHub Profile
@ashwingonsalves
ashwingonsalves / BrowserStack.robot
Last active February 27, 2020 15:37 — forked from ujwalp1994/BrowserStack.robot
Sample Test to run Robot tests on BrowserStack
*** Settings ***
Library Selenium2Library
Library Collections
Library Collections
Library String
Library BuiltIn
*** Variables ***
${SITE_URL} = https://www.browserstack.com
${SELENIUM_TIME_OUT} = 120
@ashwingonsalves
ashwingonsalves / har_logs.js
Created January 31, 2018 14:28
Pass a BrowserStack session ID to retrieve the HAR logs (provided "browserstack.networkLogs" = true is used)
const https = require('https');
const { exec } = require('child_process');
function getHarLogs (url) {
return new Promise ( (resolve, reject)=> {
https.get(url, (res) => {
if (res.statusCode !== 200){
throw "ERROR unable to retrieve HAR logs from BrowserStack: StatusCode - " + res.statusCode;
}
res.setEncoding('utf8');