Skip to content

Instantly share code, notes, and snippets.

View santiycr's full-sized avatar
💭
Always learning

Santiago Suarez Ordoñez santiycr

💭
Always learning
View GitHub Profile
@santiycr
santiycr / import_and_run.py
Created December 13, 2012 06:44
Run python unit tests from a different python script
import unittest
import test_example
unittest.main(module=test_example)
@santiycr
santiycr / TestingUploadSe2Sauce.java
Created December 22, 2011 04:44
Remote File Upload using Selenium 2's FileDetectors
import junit.framework.Assert;
import junit.framework.TestCase;
import org.openqa.selenium.*;
import org.openqa.selenium.remote.*;
import java.net.URL;
import java.util.concurrent.TimeUnit;
public class TestingUploadSe2Sauce extends TestCase {
private RemoteWebDriver driver;
@santiycr
santiycr / saucerest_python_example.py
Created January 20, 2012 01:37
Sauce REST API via Python
import httplib
import base64
try:
import json
except ImportError:
import simplejson as json
config = {"username": "your-sauce-username",
"access-key": "your-sauce-api-key"}
@santiycr
santiycr / selenium_sauce_tests.py
Created August 13, 2012 18:19
Run multiple browsers on Sauce in parallel using some python magic
#!/usr/bin/env python
# encoding: utf-8
from selenium import webdriver
import unittest
import nose
from nose.plugins.multiprocess import MultiProcess
import new
import json
import httplib
#!/usr/bin/env python
import os
import time
import subprocess
import tempfile
import zipfile
import urllib
import logging
@santiycr
santiycr / sauce_browsers_coordination.py
Created August 6, 2010 17:36
Coordinate multiple browsers in Sauce OnDemand using threads
from threading import Thread
from selenium import selenium
import time
try:
import json
except ImportError:
import simplejson as json
USERNAME = "USERNAME"
ACCESS_KEY = "ACCESS-KEY"
@santiycr
santiycr / results.json
Created May 10, 2011 02:31
Locator Performance Metrics using Selenium
{
"Windows 2003_opera_11": {
"Absolute content CSS": {
"std": 0.0062160932811327783,
"avg": 0.034599971771240232,
"values": [
0.030999898910522461,
0.030999898910522461,
0.032000064849853516,
0.046999931335449219,
@santiycr
santiycr / admin_config.reg
Created November 30, 2011 19:35
Sauce Regedits to improve testability
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE]
"iexplore.exe"=dword:0
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Internet Explorer]
"Information Bar"=dword:0
[HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer]
"New Windows"=dword:0
#!/bin/bash
#
# Restart SauceConnect via Rolling Restart
# The port it uses for listening for Selenium Relay
# is chosen automatically an ranges between 4441 and 4449
#
# Tunnel identifiers are optional, but removing them
# from this example would include some tweaking
#
import pygame, sys
from pygame.locals import *
pygame.init()
FPS = 30
fpsClock = pygame.time.Clock()
DISPLAYSURF = pygame.display.set_mode((400, 300), 0, 32)
pygame.display.set_caption('Animation');