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

Appium can use wrong session information if starting with an existing session #182

Open
ncalaway opened this issue Nov 23, 2021 · 0 comments
Assignees

Comments

@ncalaway
Copy link
Collaborator

ncalaway commented Nov 23, 2021

Appium will always use the preexisting session if it's available. This can cause problems if the session is on a different platform, using a different app, or really if there are any unexpected differences between the session described in a Flagpole test file and the session that is already running.

To reproduce:

  1. Start a session outside Flagpole with Appium Inspector. Make that session happen on an iOS device
  2. Run an Appium scenario using an Android device

We can implement checks to make sure the new opts are the same as those which are in use as capabilities. This will only check for the capabilities defined as opts in the scenario, and may miss some capabilities set in the preexisting session. However, it's likely that this will be enough for the majority of cases. Required capabilities will always be defined in a scenario; these capabilities include the automation and platform names, so an iOS session will never continue when trying to start an Android session.
We can further expand this to check the capabilities of multiple sessions to check which running session to use.

Alternatively, we can have Flagpole always close down any preexisting sessions before starting a new session. This may cause problems for running sessions in parallel, but it will guarantee that the session run on a particular scenario is exactly what is defined.

Or - we could just remove the ability to use an existing session and not close down any previous sessions. This would prevent the bug and allow parallel sessions to continue.

@ncalaway ncalaway self-assigned this Nov 23, 2021
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

1 participant