Skip to content

Instantly share code, notes, and snippets.

Avatar

Ashwin Gonsalves ashwingonsalves

View GitHub Profile
@ashwingonsalves
ashwingonsalves / BrowserStack.robot
Last active Feb 27, 2020 — forked from ujwalp1994/BrowserStack.robot
Sample Test to run Robot tests on BrowserStack
View BrowserStack.robot
*** 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 Jan 31, 2018
Pass a BrowserStack session ID to retrieve the HAR logs (provided "browserstack.networkLogs" = true is used)
View har_logs.js
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');