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

feat: Add a setting for elements bounding strategy selection #357

Merged
merged 1 commit into from
Jun 27, 2020

Conversation

mykola-mokhnach
Copy link

Adds boundElementsByIndex boolean setting, which allows to select the bounding strategy for elements lookup. Based on appium/appium#14486

/**
* Whether to bound the lookup results by index.
* By default this is disabled and bounding by accessibility is used.
* Read https://stackoverflow.com/questions/49307513/meaning-of-allelementsboundbyaccessibilityelement
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mm, i see..

@vitalyk
Copy link

vitalyk commented Nov 19, 2020

Hello @mykola-mokhnach, could you please clarify where exactly boundElementsByIndex boolean setting for the iOS should be specified in case of the following error:

 the previously found element ""currency" StaticText" is not present in the current view anymore. Make sure the application UI has the expected state. You could also try to switch the binding strategy using the 'boundElementsByIndex' setting for the element lookup. Original error: No matches found for Identity Binding from input

Thanks ahead

@KazuCocoa
Copy link
Member

@vitalyk
Copy link

vitalyk commented Nov 19, 2020

Thanks @KazuCocoa for your reply.
Sorry, it’s little bit unclear- should I add this particular setting within capabilities? e.g:

{ caps: { automationName: 'XCUITest',
              platformName: 'iOS',
              ...,
              boundElementsByIndex: true }
}

Or this is something different?
Thanks a lot for your reply.

@KazuCocoa
Copy link
Member

An API https://appium.io/docs/en/commands/session/settings/update-settings/index.html helps to set the settings. (Then, you can configure this value as you want)
You also can set it in capabilities as https://appium.io/docs/en/writing-running-appium/caps/#update-settings . Then, appium will call the settings API internally as part of a new session request.

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.

None yet

3 participants