Skip to content

Instantly share code, notes, and snippets.

@rgr2k
rgr2k / BotStyleTest
Created August 6, 2012 19:58
BotStyletests
* Type something into an input field. WebDriver doesn't normally clear these
<rgr> * before typing, so this method does that first. It also sends a return key
<rgr> * to move the focus out of the element.
<rgr> */
<rgr> public void type(By locator, String text) {
<rgr> WebElement element = driver.findElement(locator);
<rgr> element.clear();
<rgr> element.sendKeys(text + "\n");
<rgr> }
<rgr> }
@rgr2k
rgr2k / chromedrivertest.java
Created August 13, 2012 16:15
Chrome Driver PT-BR
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver","/home/rgr/chromedriver");
ChromeOptions options = new ChromeOptions();
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
Map<String, String> chromePrefs = new HashMap<String,String>();
chromePrefs.put("settings.language.preferred_languages", "pt-BR");
@rgr2k
rgr2k / UnreachableBrowserException-webdriver
Created September 27, 2012 14:39
UnreachableBrowserException
org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 22:18:01'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '2.6.38-15-generic', java.version: '1.6.0_24'
Driver info: driver.version: RemoteWebDriver
@rgr2k
rgr2k / cssify.js
Created October 21, 2012 23:37 — forked from Dither/cssify.js
Convert XPath to CSS selector
// JavaScript function for converting simple XPath to CSS selector.
// Ported by Dither from [cssify](https://github.com/santiycr/cssify)
// Example: `cssify('//div[@id="girl"][2]/span[@class="body"]//a[contains(@class, "sexy")]//img[1]')`
var sub_regexes = {
"tag": "([a-zA-Z][a-zA-Z0-9]{0,10}|\\*)",
"attribute": "[.a-zA-Z_:][-\\w:.]*(\\(\\))?)",
"value": "\\s*[\\w/:][-/\\w\\s,:;.]*"
};
@rgr2k
rgr2k / jsexecutor
Created October 23, 2012 16:42
Javascript Executor example
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("document.getElementsByClassName('submenu')[1].style.display='block';");
@rgr2k
rgr2k / gist:5748262
Created June 10, 2013 12:05
Descrição Longa para teste share youtube.
guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica
guarana antarctica picaretas 020515s040416h guarana antarctica
guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica
guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica
guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica guarana antarctica picaretas 020515s040416h guarana antarctica picaretas 020515s040416h guarana antarctica pica
@rgr2k
rgr2k / Doc API
Created June 25, 2013 18:59
SambaVideos API
SambaVideos API!
=====================
Este documento descreve os recursos que compõem a API do **SambaVideos**. Se você tiver quaisquer problemas ou pedidos, por favor, contate o suporte clicando aqui.
----------
Conteúdo
-------
@rgr2k
rgr2k / gist:18c6fe6f208d05a0d061
Created August 8, 2014 19:11
bootstrap.min.css
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
@rgr2k
rgr2k / UrlFilterConfig.sql
Created November 6, 2014 17:36
Url Filter Config
<UrlFilterConfig>
<rules ruleName="r1" osName="*" osGroup="IOS" osVersion="*" osDeviceType="*" osIsMobile="*" browserName="*" browserGroup="*" browserVersion="*" flashVersion="*" outputs="*" urlType="HLSAKAMAI" />
<rules ruleName="r2" osName="*" osGroup="ANDROID" osVersion="*" osDeviceType="*" osIsMobile="*" browserName="*" browserGroup="*" browserVersion="*" flashVersion="*" outputs="*" urlType="HLSAKAMAI" />
<rules ruleName="r3" osName="*" osGroup="BLACKBERRY" osVersion="*" osDeviceType="*" osIsMobile="*" browserName="*" browserGroup="*" browserVersion="*" flashVersion="*" outputs="BlackBerry" urlType="RTSP" />
<rules ruleName="r4" osName="*" osGroup="*" osVersion="*" osDeviceType="COMPUTER" osIsMobile="*" browserName="*" browserGroup="*" browserVersion="*" flashVersion="*" outputs="*" urlType="HDS" />
</UrlFilterConfig>
@rgr2k
rgr2k / cdndeliveryconfig
Created November 6, 2014 17:37
Cdn Delivery Config
<CDNDeliveryConfig>
<httpDelivery>
<priority>0</priority>
<provider>Akamai</provider>
<prefix>http://akmd.sambavideos.sambatech.com</prefix>
</httpDelivery>
<rtmpDelivery>
<priority>0</priority>
<provider>Akamai</provider>
<prefix>rtmp://akms.sambavideos.sambatech.com/ondemand</prefix>