Skip to content

Instantly share code, notes, and snippets.

View DominikDary's full-sized avatar

Dominik Dary DominikDary

View GitHub Profile
@DominikDary
DominikDary / 10-18.java
Created January 29, 2014 09:22
configure android web view proxy
//Source: http://stackoverflow.com/a/18453384
public static boolean setProxy(WebView webview, String host, int port) {
// 3.2 (HC) or lower
if (Build.VERSION.SDK_INT <= 13) {
return setProxyUpToHC(webview, host, port);
}
// ICS: 4.0
else if (Build.VERSION.SDK_INT <= 15){
return setProxyICS(webview, host, port);
}
from selenium import webdriver;
from selenium.webdriver.common.action_chains import ActionChains;
driver=webdriver.Remote(desired_capabilities={'aut': 'io.selendroid.testapp:0.8.0-SNAPSHOT','emulator':True}) ;
chain = ActionChains(driver);
""" Send search key, enter the text "Selendroid" and press the "Enter key" """
chain.send_keys(u'\ue103'+'Selendroid'+u'\ue007').perform();
'''
@author: Dominik Dary
'''
import unittest
from selenium import webdriver
class FindElementTest(unittest.TestCase):
def setUp(self):
{
"desiredCapabilities":{
"screenSize":"320x480",
"emulator":true,
"locale":"en_US",
"androidTarget":"ANDROID16",
"aut":"io.selendroid.testapp:0.4-SNAPSHOT"
}
}
@dtmilano
dtmilano / android-select-device
Last active February 28, 2025 18:51
Script to select one connected device or emulator when running adb
#! /bin/bash
#=====================================================================
# Selects an android device
# Copyright (C) 2012-2022 Diego Torres Milano. All rights reserved.
#
# The simplest way to invoke this script is creating a function like
# this one in your shell startup file:
#
# ```
# adb ()
@davetron5000
davetron5000 / Checkstyle pre-commit hook
Created December 18, 2008 02:40
Pre Commit Hook for running checkstyle on changed files
#!/usr/bin/perl
#
# Pre-commit hook for running checkstyle on changed Java sources
#
# To use this you need:
# 1. checkstyle's jar file somewhere
# 2. a checkstyle XML check file somewhere
# 3. To configure git:
# * git config --add checkstyle.jar <location of jar>
# * git config --add checkstyle.checkfile <location of checkfile>