Skip to content

fix: support non-global drivers in get_android_inspect and px_to_window_rel and preserve kwargs in promote_appium_methods - #1143

Open
hoanle0126 wants to merge 1 commit into
appium:masterfrom
hoanle0126:fix/non-global-driver-helpers
Open

hoanle0126 wants to merge 1 commit into
appium:masterfrom
hoanle0126:fix/non-global-driver-helpers

Conversation

@hoanle0126

Copy link
Copy Markdown
Contributor

Summary

When Appium::Driver is initialized with the default global_driver = false ($driver is nil):

  • get_android_inspect (and page) previously instantiated AndroidElements.new without passing the current driver instance, causing AndroidElements#start_element to call nil.lazy_load_strings when Nokogiri's SAX parser invoked start_element(name, attrs). This change passes self to AndroidElements.new(self) and falls back to {} if driver is nil.
  • px_to_window_rel previously required 'ostruct' to already be loaded by the caller and defaulted driver to $driver (nil). This change requires 'ostruct' in Appium::Common and defaults driver to $driver || self.
  • Appium.promote_appium_methods now forwards *args, **kwargs, &block directly (matching promote_singleton_appium_methods), avoiding a TypeError when passing a string-keyed positional hash to a promoted instance method.

How Has This Been Tested?

  • bundle exec ruby -Ilib -Itest test/regression_test.rb
  • bundle exec rubocop

Checklist

  • bundle exec rake rubocop

@hoanle0126
hoanle0126 requested a review from KazuCocoa as a code owner October 28, 2026 08:48
…ow_rel and preserve kwargs in promote_appium_methods
@hoanle0126
hoanle0126 force-pushed the fix/non-global-driver-helpers branch from 647a264 to deaace1 Compare October 28, 2026 10:08

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant