Skip to content

Commit

Permalink
Merge branch 'trunk' into renovate/grpc-java-monorepo
Browse files Browse the repository at this point in the history
  • Loading branch information
VietND96 authored Jan 19, 2025
2 parents 820c0c2 + a62ef3d commit e42c609
Show file tree
Hide file tree
Showing 2 changed files with 563 additions and 41 deletions.
53 changes: 52 additions & 1 deletion py/selenium/webdriver/common/by.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,58 @@


class By:
"""Set of supported locator strategies."""
"""Set of supported locator strategies.
ID:
--
Select the element by its ID.
>>> element = driver.find_element(By.ID, 'myElement')
XPATH:
------
Select the element via XPATH.
- absolute path
- relative path
>>> element = driver.find_element(By.XPATH, '//html/body/div')
LINK_TEXT:
----------
Select the link element having the exact text.
>>> element = driver.find_element(By.LINK_TEXT, 'myLink')
PARTIAL_LINK_TEXT:
------------------
Select the link element having the partial text.
>>> element = driver.find_element(By.PARTIAL_LINK_TEXT, 'my')
NAME:
----
Select the element by its name attribute.
>>> element = driver.find_element(By.NAME, 'myElement')
TAG_NAME:
--------
Select the element by its tag name.
>>> element = driver.find_element(By.TAG_NAME, 'div')
CLASS_NAME:
----------
Select the element by its class name.
>>> element = driver.find_element(By.CLASS_NAME, 'myElement')
CSS_SELECTOR:
-------------
Select the element by its CSS selector.
>>> element = driver.find_element(By.CSS_SELECTOR, 'div.myElement')
"""

ID = "id"
XPATH = "xpath"
Expand Down
Loading

0 comments on commit e42c609

Please sign in to comment.