Skip to content

Commit 4754137

Browse files
Fix id resolution. Fix patch and helper
1 parent 38af1aa commit 4754137

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

android_tests/lib/android/specs/android/patch.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
describe 'android/patch.rb' do
22
t 'type' do
33
# nav to textfield
4-
text('app').click
5-
text('search').click
6-
text('invoke').click
4+
find('app').click
5+
find('search').click
6+
find('invoke').click
77

88
ele = first_textfield
99
ele.type 'ok'

lib/appium_lib/android/helper.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ def current_app
106106
# @return [Element]
107107
def id id
108108
value = resolve_id id
109-
raise "Invalid id `#{id}`" unless value
109+
# If the id doesn't resolve in strings.xml then use it as is
110+
# It's probably a resource id which won't be in strings.xml
111+
value = id unless value
110112
exact = string_visible_exact '*', value
111113
contains = string_visible_contains '*', value
112114
xpath "#{exact} | #{contains}"

0 commit comments

Comments
 (0)