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();
from selenium import webdriver;
driver = webdriver.Remote(desired_capabilities=webdriver.DesiredCapabilities.ANDROID)
driver.get("http://www.meteofrance.com/mf3-rpc-portlet/html/redirection.html")
touch =webdriver.TouchActions(driver)
el=driver.find_element_by_link_text("Non")
touch.tap(el).perform()
import unittest
from selenium import webdriver
class Bug167(unittest.TestCase):
def setUp(self):
desired_capabilities = {'aut': 'io.selendroid.testapp:0.7.0','androidTarget':'ANDROID19'}
self.driver = webdriver.Remote(
#!/usr/bin/python
# Copyright 2011 Software Freedom Conservancy.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@DominikDary
DominikDary / ipin.py
Created November 18, 2013 16:04 — forked from urielka/ipin.py
#---
# iPIN - iPhone PNG Images Normalizer v1.0
# Copyright (C) 2007
#
# Author:
# Axel E. Brzostowski
# http://www.axelbrz.com.ar/
# axelbrz@gmail.com
#
# References:
@DominikDary
DominikDary / Bug122.java
Created October 21, 2013 06:26
Verification of Selendroid bug #122
/*
* Copyright 2012-2013 eBay Software Foundation and selendroid committers.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
'''
@author: Dominik Dary
'''
import unittest
from selenium import webdriver
class FindElementTest(unittest.TestCase):
def setUp(self):
public static void driverLogs(WebDriver driver, String className, String methodName) {
LogEntries logs;
try {
logs = driver.manage().logs().get("logcat");
} catch (Exception e) {
return;
} catch (OutOfMemoryError e) {
System.out.println("failed to get logcat due to OOM current max memory:" + Runtime.getRuntime().maxMemory() +
" current free memory: " + Runtime.getRuntime().freeMemory() );
return;
from selenium import webdriver
d=webdriver.Remote(command_executor='http://localhost:5555/wd/hub', desired_capabilities={"aut":"io.selendroid.testapp:0.5.0-SNAPSHOT","emulator":bool(0)})