We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8d19157 commit c5211e5Copy full SHA for c5211e5
lib/appium_lib/android/helper.rb
@@ -358,12 +358,21 @@ def run node
358
out += " name: #{e_desc}\n" unless e_desc.nil?
359
end
360
361
- id_match = @strings_xml.detect do |kv|
+ # there may be many ids with the same value.
362
+ # output all exact matches.
363
+ id_matches = @strings_xml.select do |kv|
364
value = kv.last
365
value == e_desc || value == e_text
366
- # [0] = key, [1] = value
- out += " id: #{id_match[0]}\n" if id_match
367
+
368
+ if id_matches && id_matches.length > 0
369
+ match_str = ''
370
+ # [0] = key, [1] = value
371
+ id_matches.each do |match|
372
+ match_str += ' ' * 6 + "#{match[0]}\n"
373
+ end
374
+ out += " id: #{match_str.strip}\n"
375
376
}
377
out
378
0 commit comments