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 / 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 / setContext-user-extension.js
Created November 23, 2010 23:06
User extension to make Selenium's setContext more visual and useful in videos recorded from tests
window.contextTimeout = null;
function fade(ctx) {
var alpha = ctx.style.opacity;
var new_alpha = alpha - 0.1;
ctx.style.opacity = new_alpha;
if (new_alpha){
window.contextTimeout = setTimeout(function(){fade(ctx);}, 50);
} else {
this.browserbot.getUserWindow().document.body.removeChild(ctx);
@santiycr
santiycr / telling-stories-at-sauce-user-extensions.py
Created November 30, 2010 08:50
Sauce OnDemand test using the new setContext extension
from selenium import selenium
import unittest, time
class sauce(unittest.TestCase):
def setUp(self):
self.browser = selenium(
'ondemand.saucelabs.com',
80,
"""{\
"username": "<username>",\
build/python/bin/py.test build/lib/selenium/test/selenium/webdriver/firefox
Traceback (most recent call last):
File "/Users/sso/Dev/selenium_new/build/python/bin/py.test", line 8, in <module>
load_entry_point('pytest==2.0.0', 'console_scripts', 'py.test')()
File "/Users/sso/Dev/selenium_new/build/python/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 318, in load_entry_point
File "/Users/sso/Dev/selenium_new/build/python/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 2221, in load_entry_point
File "/Users/sso/Dev/selenium_new/build/python/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py", line 1954, in load
File "/Users/sso/Dev/selenium_new/build/python/lib/python2.6/site-packages/pytest.py", line 7, in <module>
from _pytest.core import main, UsageError, _preloadplugins
File "/Users/sso/Dev/selenium_new/build/python/lib/python2.6/site-packages/_pytest/core.py", line 10, in <module>
./go test_firefox_py 16:01
(in /Users/sso/Dev/proyectos_OS/selenium/trunk)
No Gecko sdk detected. Install xulrunner-dev to compile 64-bit Firefox extension.No srcs specified for selenium-core
virtualenv --no-site-packages build/python
New python executable in build/python/bin/python
Installing setuptools............done.
build/python/bin/pip install simplejson py pytest
Downloading/unpacking py
Downloading py-1.4.0.zip (222Kb): 222Kb downloaded
Running setup.py egg_info for package py
def switch_jobs_page(self):
user = User.load(c.loginname)
new_version = int(request.params.get("version", 2))
user['JobsPageVersion'] = new_version
user.overwrite_fields(["JobsPageVersion"])
record_metric("jobs_page_version_switched", new_version)
redirect_to(h.url_for("jobs"))
15:32:50.809 INFO [10] org.openqa.selenium.server.SeleniumServer - Writing debug logs to c:\log\selenium-server-interactive.log
15:32:50.809 INFO [10] org.openqa.selenium.server.SeleniumServer - Java: Sun Microsystems Inc. 17.0-b17
15:32:50.809 INFO [10] org.openqa.selenium.server.SeleniumServer - OS: Windows 2003 5.2 x86
15:32:50.809 INFO [10] org.openqa.selenium.server.SeleniumServer - v2.0 [b1], with Core v2.0 [b1]
15:32:50.825 DEBUG [10] org.openqa.jetty.util.Container - add component: SocketListener0@0.0.0.0:4443
15:32:50.856 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@14d3343
15:32:50.856 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.ProxyHandler in HttpContext[/,/]
15:32:50.856 DEBUG [10] org.openqa.jetty.util.Container - add component: HttpContext[/,/]
15:32:50.856 DEBUG [10] org.openqa.jetty.http.HttpServer - Added HttpContext[/,/] for host *
15:32:50.856 DEBUG [10] org.openqa.jetty.util.Container - add compo
13:09:47.900 INFO [10] org.openqa.selenium.server.SeleniumServer - Writing debug logs to c:\log\selenium-server-interactive.log
13:09:47.916 INFO [10] org.openqa.selenium.server.SeleniumServer - Java: Sun Microsystems Inc. 17.0-b17
13:09:47.916 INFO [10] org.openqa.selenium.server.SeleniumServer - OS: Windows 2003 5.2 x86
13:09:47.916 INFO [10] org.openqa.selenium.server.SeleniumServer - v2.0 [b1], with Core v2.0 [b1]
13:09:48.010 DEBUG [10] org.openqa.jetty.util.Container - add component: SocketListener0@0.0.0.0:4443
13:09:48.025 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.jetty.http.ResourceCache@a01335
13:09:48.025 DEBUG [10] org.openqa.jetty.util.Container - add component: org.openqa.selenium.server.ProxyHandler in HttpContext[/,/]
13:09:48.025 DEBUG [10] org.openqa.jetty.util.Container - add component: HttpContext[/,/]
13:09:48.025 DEBUG [10] org.openqa.jetty.http.HttpServer - Added HttpContext[/,/] for host *
13:09:48.025 DEBUG [10] org.openqa.jetty.util.Container - add compon
@santiycr
santiycr / gist:816927
Created February 8, 2011 18:35
firefox 4 failure
18:27:58.743 INFO - Writing debug logs to c:\log\selenium-server-interactive.log
18:27:58.751 INFO - Java: Sun Microsystems Inc. 17.0-b17
18:27:58.751 INFO - OS: Windows Server 2008 6.0 x86
18:27:58.755 INFO - v2.0 [a7], with Core v2.0 [a7]
18:27:58.995 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4443/wd/hub
18:27:58.996 INFO - Version Jetty/5.1.x
18:27:58.997 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
18:27:58.999 INFO - Started HttpContext[/selenium-server,/selenium-server]
18:27:58.999 INFO - Started HttpContext[/,/]
18:27:59.028 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@19ee1ac
@santiycr
santiycr / gist:816930
Created February 8, 2011 18:36
ie9 failure
18:26:02.311 INFO - Writing debug logs to c:\log\selenium-server-interactive.log
18:26:02.318 INFO - Java: Sun Microsystems Inc. 17.0-b17
18:26:02.318 INFO - OS: Windows Server 2008 6.0 x86
18:26:02.324 INFO - v2.0 [a7], with Core v2.0 [a7]
18:26:02.644 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4443/wd/hub
18:26:02.645 INFO - Version Jetty/5.1.x
18:26:02.646 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
18:26:02.648 INFO - Started HttpContext[/selenium-server,/selenium-server]
18:26:02.648 INFO - Started HttpContext[/,/]
18:26:02.739 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@9931f5