kivy / kivy/telenium

select() may generate an identifier that is unusable

Open
#23 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
68
Forks
22
PR merge metrics
No merged PRs in 30d

Description

When using the `select()` function, the provided path cannot necessarily be used for a subsequent `select()` (or `getattr()`, etc) and will not properly select any items.

This appears to arise because the XPATH index syntax is slightly different than the `path_to` syntax use different semantics.

Specifically, the current `to_path` syntax uses the index of the element in the child widgets list.
https://github.com/tito/telenium/blob/52e30bad3025c31749e9bab50a4bc5b62467679e/telenium/mods/telenium_client.py#L107-L114

However, the XPATH syntax uses the index into the list **of previously filtered items**. This means that if any items are filtered out, the index used by XPATH and the index into the Kivy child list are no longer equivalent.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in telenium/mods/telenium_client.py at lines 107-114, where the path and child-widget index are assembled. Compare the child-widget indexing used by to_path with the filtered-item indexing required by XPath, then trace select() and related getattr() handling. Done means a path returned by select() remains usable for subsequent selection or attribute lookup.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.