Skip to content

Commit d2f22ce

Browse files
reverted return type, moved bytype to module level, added by import
1 parent 06d3045 commit d2f22ce

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

py/selenium/webdriver/common/by.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
ByType = Literal["id", "xpath", "link text", "partial link text", "name", "tag name", "class name", "css selector"]
2222

23+
2324
class By:
2425
"""Set of supported locator strategies.
2526
@@ -74,7 +75,6 @@ class By:
7475
>>> element = driver.find_element(By.CSS_SELECTOR, "div.myElement")
7576
"""
7677

77-
7878
ID: ByType = "id"
7979
XPATH: ByType = "xpath"
8080
LINK_TEXT: ByType = "link text"
@@ -97,6 +97,3 @@ def get_finder(cls, name: str) -> Optional[str]:
9797
@classmethod
9898
def clear_custom_finders(cls) -> None:
9999
cls._custom_finders.clear()
100-
101-
102-

py/selenium/webdriver/support/relative_locator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
from typing import NoReturn, Optional, Union, overload
1919

2020
from selenium.common.exceptions import WebDriverException
21-
from selenium.webdriver.common.by import ByType
22-
from selenium.webdriver.common.by import By
21+
from selenium.webdriver.common.by import By, ByType
2322
from selenium.webdriver.remote.webelement import WebElement
2423

2524

@@ -51,6 +50,7 @@ def with_tag_name(tag_name: str) -> "RelativeBy":
5150
raise WebDriverException("tag_name can not be null")
5251
return RelativeBy({By.CSS_SELECTOR: tag_name})
5352

53+
5454
def locate_with(by: ByType, using: str) -> "RelativeBy":
5555
"""Start searching for relative objects your search criteria with By.
5656

0 commit comments

Comments
 (0)