Skip to content

Shadow Dom GetHtml and Retry Logic Update #74

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

Merged
merged 7 commits into from
May 13, 2025
Merged

Conversation

MiriamKyoseva
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
@MiriamKyoseva MiriamKyoseva requested a review from n1xan May 1, 2025 09:43
@MiriamKyoseva MiriamKyoseva requested a review from teo-nikolov May 13, 2025 10:06
@MiriamKyoseva MiriamKyoseva merged commit b2e25c8 into main May 13, 2025
1 check passed
@MiriamKyoseva MiriamKyoseva 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