Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self.driver.window_handles returns the list randomly #1076

Open
ammaramja opened this issue Dec 16, 2024 · 2 comments
Open

self.driver.window_handles returns the list randomly #1076

ammaramja opened this issue Dec 16, 2024 · 2 comments

Comments

@ammaramja
Copy link

The problem

self.driver.window_handles returns the list randomly, earlier the latest window handle used to be max from the list, now its neither max nor latest element of the array i.e -1 so there is no concrete way to switch to the latest window.

Environment

  • Appium version: 2.13.1
  • Last Appium version that did not exhibit the issue (if applicable): 1.65
  • Desktop OS/version used to run Appium:
  • Node.js version (unless using Appium.app|exe): v18.19.1
  • Mobile platform/version under test: Samsung S23 FE
  • Real device or emulator/simulator:
  • Appium CLI or Appium.app|exe:

Link to Appium Logs

appium_server_logs_11-27-37.log

Create a GIST which is a paste of your full Appium logs, and link them here.

Code To reproduce issue

        ```
        self.appium_opr.switch_context(self.instance, "web")
        time.sleep(CONTEXT_WAIT)
        all_windows = self.instance.window_handles
        window_after = max(all_windows)
        self.instance.switch_to.window(window_after)
        url = self.instance.current_url
@mykola-mokhnach
Copy link
Contributor

AFAIK the standard does not define any particular order in there. Reordering returned handles forcefully would be a breaking change.

@KazuCocoa
Copy link
Member

Btw, is it by chromedriver behavior thing?

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

No branches or pull requests

3 participants