$ node .
info: Welcome to Appium v0.17.2 (REV f46a221b380630a1cbf6dbcb18511c3dc2d5e916)
info: Appium REST http interface listener started on 0.0.0.0:4723
info - socket.io started
info: Non-default server args: {"merciful":true}
debug: Appium request initiated at /wd/hub/session/9c4abc4d-917c-40be-8e44-36f45ae587ab
debug: Request received with params: {}
DELETE /wd/hub/session/9c4abc4d-917c-40be-8e44-36f45ae587ab 404 10ms - 53b
debug: Appium request initiated at /wd/hub/session
pip install ipython
scrapy shell http://www.example.com
- longTap's mLongPressTimeout is too short.
- https://android.googlesource.com/platform/frameworks/testing/+/android-sdk-support_r11/uiautomator/library/src/com/android/uiautomator/core/InteractionController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find open webviews on API 19 Android emulator. | |
def print_webviews | |
webviews = `adb shell cat /proc/net/unix` | |
webview_prefix = '@webview_devtools_remote_' | |
webviews = webviews.split("\r\n").reject { |l| ! l.include?(webview_prefix) } | |
# one pid may have many webviews | |
pids = webviews.map { |view| view.split(webview_prefix).last }.uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- security authorizationdb read system.privilege.taskport > system.privilege.taskport.txt | |
DevToolsSecurity --enable | |
security authorizationdb write system.privilege.taskport is-developer | |
Fix developer popup. | |
Commands from: https://github.com/appium/appium/pull/1468 | |
--> | |
<?xml version="1.0" encoding="UTF-8"?> |
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:130)
... 20 more
Caused by: java.lang.NoClassDefFoundError: Lorg/sonatype/aether/RepositorySystem;
at java.lang.Class.getDeclaredFields0(Native Method)
at java.lang.Class.privateGetDeclaredFields(Class.java:2397)
at java.lang.Class.getDeclaredFields(Class.java:1806)
at com.google.inject.spi.InjectionPoint.getInjectionPoints(InjectionPoint.java:661)
at com.google.inject.spi.InjectionPoint.forInstanceMethodsAndFields(InjectionPoint.java:366)
at com.google.inject.internal.ConstructorBindingImpl.getInternalDependencies(ConstructorBindingImpl.java:165)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example of Ruby page object pattern | |
module App | |
module Splash | |
class << self | |
def login | |
'login' | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'method_source' | |
ary = [] | |
class Test | |
def self.run &block | |
define_method :run_method do | |
# https://www.ruby-forum.com/topic/4416134#1117671 | |
eval %(ary << 1; puts 'complete'), block.binding |
Ruby
scroll_to('views').click
scroll_to('tabs').click
scroll_to('content by id').click
s_text(0).selected?.must_equal false
s_text(1).selected?.must_equal true
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gem install nokogiri escape_utils | |
text = '' | |
reader = Nokogiri::XML::Reader(File.open(file)) | |
reader.each do |n| | |
text += ' ' + n.value + ' ' if n.value? | |
end | |
# double unescape | |
text = EscapeUtils.unescape_html text | |
text = EscapeUtils.unescape_html text |