Skip to content

Update docstring of wait.py so it can also cover the case of WebElement as 1st arg of WebDriverWait. - #12376

Merged
diemol merged 2 commits into
SeleniumHQ:trunkfrom
ggkiokas:patch-1
Jul 21, 2023
Merged

Update docstring of wait.py so it can also cover the case of WebElement as 1st arg of WebDriverWait.#12376
diemol merged 2 commits into
SeleniumHQ:trunkfrom
ggkiokas:patch-1

Conversation

@ggkiokas

@ggkiokas ggkiokas commented Jul 18, 2023

Copy link
Copy Markdown
Contributor

The 1st argument can be either Instance of WebDriver or a WebElement. If it is a WebElement it can be used to get another element using as base the the previous one and having a relative locator. The logic is identical with:
relative_element = base_element.find_element(By.XPATH, "./relative_xpath")

Thanks for contributing to Selenium!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

The 1st argument can be either Instance of WebDriver or a WebElement. 
If it is a WebElement it can be used to get another element using as base the the previous one and having a relative locator.
The logic is identical with:
relative_element = base_element.find_element(By.XPATH, "./relative_xpath")
@CLAassistant

CLAassistant commented Jul 18, 2023

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@diemol diemol left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you, @ggkiokas!

@ggkiokas ggkiokas closed this Jul 21, 2023
@ggkiokas ggkiokas reopened this Jul 21, 2023
@diemol
diemol merged commit fb4c62e into SeleniumHQ:trunk Jul 21, 2023
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.

3 participants