Skip to content

Commit f43309c

Browse files
Fix #192
Add nil check Fix spam in native context /cc @DylanLacey Called get_page on {"name"=>nil, "type"=>"UIAToolbar", "label"=>nil, "value"=>nil, "rect"=>{"origin"=>{"x"=>0, "y"=>568}, "size"=>{"width"=>320, "height"=>44}}, "dom"=>nil, "enabled"=>true, "valid"=>true, "visible"=>false, "children"=>[{"name"=>nil, "type"=>"UIAImage", "label"=>nil, "value"=>nil, "rect"=>{"origin"=>{"x"=>0, "y"=>567.5}, "size"=>{"width"=>320, "height"=>0.5}}, "dom"=>nil, "enabled"=>true, "valid"=>true, "visible"=>false, "children"=>[], "hint"=>nil}, {"name"=>nil, "type"=>"UIAImage", "label"=>nil, "value"=>nil, "rect"=>{"origin"=>{"x"=>0, "y"=>568}, "size"=>{"width"=>320, "height"=>44}}, "dom"=>nil, "enabled"=>true, "valid"=>true, "visible"=>false, "children"=>[], "hint"=>nil}], "hint"=>nil} Called get_page on {"name"=>nil, "type"=>"UIAImage", "label"=>nil, "value"=>nil, "rect"=>{"origin"=>{"x"=>0, "y"=>567.5}, "size"=>{"width"=>320, "height"=>0.5}}, "dom"=>nil, "enabled"=>true, "valid"=>true, "visible"=>false, "children"=>[], "hint"=>nil} Called get_page on {"name"=>nil, "type"=>"UIAImage", "label"=>nil, "value"=>nil, "rect"=>{"origin"=>{"x"=>0, "y"=>568}, "size"=>{"width"=>320, "height"=>44}}, "dom"=>nil, "enabled"=>true, "valid"=>true, "visible"=>false, "children"=>[], "hint"=>nil}
1 parent 4a97ba1 commit f43309c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

android_tests/appium.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[caps]
22
platformName = "android"
33
app = "./api.apk"
4+
appPackage = ""
5+
appActivity = ""
46

57
[appium_lib]
68
sauce_username = ""

lib/appium_lib/ios/helper.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ def ios_password length=1
1818
# @option class_name [String,Symbol] the class name to filter on. case insensitive include match.
1919
# @return [String]
2020
def get_page element=source_window(0), class_name=nil
21-
puts "Called get_page on #{element}"
2221
lazy_load_strings # populate @strings_xml
2322
class_name = class_name.to_s.downcase
2423

@@ -131,7 +130,8 @@ def page opts={}
131130
window_number = -1
132131
class_name = opts
133132
end
134-
if current_context.start_with? 'WEBVIEW'
133+
# current_context may be nil which breaks start_with
134+
if current_context && current_context.start_with?('WEBVIEW')
135135
s = get_source
136136
parser = @android_html_parser ||= Nokogiri::HTML::SAX::Parser.new(Common::HTMLElements.new)
137137
parser.document.reset

0 commit comments

Comments
 (0)