This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import base64 | |
USERNAME = "" | |
BROWSERSTACK_KEY = "" | |
BUILD = "" | |
SESSION = "" | |
def get_screen_shot(BUILD, SESSION): | |
req = urllib2.Request('https://www.browserstack.com/automate/builds/%s/sessions/%s/logs.json'%(BUILD, SESSION)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package juto; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.Platform; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.remote.RemoteWebDriver; | |
import java.net.URL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webdriver = require('browserstack-webdriver'), | |
fs = require('fs'); | |
// Input capabilities | |
var capabilities = { | |
'browserName' : 'firefox', | |
'browserstack.user' : '<username>', | |
'browserstack.key' : '<key>' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var webdriver = require('browserstack-webdriver'), | |
fs = require('fs'); | |
// Input capabilities | |
var capabilities = { | |
'browserName' : 'firefox', | |
'browserstack.user' : '<username>', | |
'browserstack.key' : '<access_key>' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.By; | |
import org.openqa.selenium.Cookie; | |
import org.openqa.selenium.Platform; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.chrome.ChromeOptions; | |
import org.openqa.selenium.remote.CapabilityType; | |
import org.openqa.selenium.remote.DesiredCapabilities; | |
import org.openqa.selenium.remote.RemoteWebDriver; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024); | |
var tempFunc = function(){ | |
db.transaction(function (tx) { | |
tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)'); | |
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (1, \"foobar\")'); | |
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (2, \"logmsg\")'); | |
msg = '<p>Log message created and row inserted.</p>'; | |
console.log(msg); | |
}); | |
db.transaction(function (tx) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def webSqlTest(driver) | |
driver.get("http://www.google.com") | |
ret_val = driver.execute_script " | |
var db = openDatabase('mydb', '1.0', 'Test DB', 2 * 1024 * 1024); | |
var tempFunc = function(){ | |
db.transaction(function (tx) { | |
tx.executeSql('CREATE TABLE IF NOT EXISTS LOGS (id unique, log)'); | |
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (1, \"foobar\")'); | |
tx.executeSql('INSERT INTO LOGS (id, log) VALUES (2, \"logmsg\")'); | |
msg = '<p>Log message created and row inserted.</p>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* require, fs, wd, assert, colors | |
* saves screenshot in current folder as hello.png | |
*/ | |
var fs = require('fs'); | |
module.exports = function helloBrowserStack(browser, cb) { | |
browser.get("http://www.google.com", function() { | |
browser.title(function(err, title) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright Akshay Bhardway, 2014 | |
* Node.js wd browserstack sample with screenshot taking and saving it locally | |
*/ | |
var webdriver = require('wd') | |
, assert = require('assert') | |
, colors = require('colors') | |
, fs = require('fs'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'time' | |
bs_response_time_arr = [] | |
client_request_time_arr = [] | |
flag = true | |
prev_request_time = nil | |
prev_response_time = nil | |
class Array | |
def avg | |
return 0 if self.length == 0 | |
self.inject(0.0){|x,y| x + y} / self.length |
OlderNewer