Skip to content

Shadow Dom GetHtml and Retry Logic Update#74

Merged
mei-kyoseva merged 7 commits intomainfrom
shadow-dom-update
May 13, 2025
Merged

Shadow Dom GetHtml and Retry Logic Update#74
mei-kyoseva merged 7 commits intomainfrom
shadow-dom-update

Conversation

@mei-kyoseva
Copy link
Collaborator

  • due to recent changes, getHtml stopped returning the actual shadow dom html in case the current element is ShadowRoot; fixed
  • retry logic for createAll (searching for multiple elements) was moved to create (searching for only one element), as it is a valid case to return a list of 0 elements. Furthermore retrying for a specified time and throwing an exception after that if no element was found is valid for create

…hadowRoot

- due to changes in inShadowContext() method, the getHtml never returns the actual shadow dom html if the element is ShadowRoot
As per the logic in Selenium:
- It is a valid case to return an empty list of components
- the user should add retry logic to createAll if they intend to wait for some element to appear
- the user should write themselves logic to throw an exception if finding 0 elements is unacceptable
- an exception should be thrown in case one searches for 1 element and it is not found after retrying for the specified time
- the user should try-catch if it happens to be a valid case to not find any element matching the locator
@mei-kyoseva mei-kyoseva requested a review from n1xan May 1, 2025 09:43
@mei-kyoseva mei-kyoseva requested a review from teo-nikolov May 13, 2025 10:06
@mei-kyoseva mei-kyoseva merged commit b2e25c8 into main May 13, 2025
1 check passed
@mei-kyoseva mei-kyoseva deleted the shadow-dom-update branch May 13, 2025 12:20
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.

2 participants