Skip to content

Instantly share code, notes, and snippets.

View wongJonathan's full-sized avatar

Jonathan Wong wongJonathan

  • Citi
  • New York, New York
View GitHub Profile
@wongJonathan
wongJonathan / SauceLabs_Selenium_Script.py
Created May 23, 2017 13:10
Selenium script to use SauceLabs.
from selenium import webdriver
# This is the only code you need to edit in your existing scripts.
# The command_executor tells the test to run on Sauce, while the desired_capabilities
# parameter tells us which browsers and OS to spin up.
desired_cap = {
'platform': "Mac OS X 10.9",
'browserName': "chrome",
'version': "31",
'useSauceLabs': True
@wongJonathan
wongJonathan / read_elasticache_items.py
Created April 17, 2017 19:20
Reads n number of elasticache objects
import redis
import random
r = redis.StrictRedis(host='jwong-test-2-001.nkrcoi.0001.usw2.cache.amazonaws.com', port=6379, db=0)
n = 1000
for counter in range(0,n+1):
rand = random.randint(0,n)
print r.get('session_id_{0}'.format(rand))
print counter