1616# under the License.
1717
1818from hashlib import md5 as md5_hash
19- from typing import List
20- from typing import Optional
21- from typing import Union
2219
2320from ..common .by import By
24- from ..common .by import ByType
25- from ..support .relative_locator import RelativeBy
2621from .command import Command
27- from .webelement import WebElement
2822
2923
3024class ShadowRoot :
@@ -45,7 +39,7 @@ def __repr__(self) -> str:
4539 type (self ), self .session .session_id , self ._id
4640 )
4741
48- def find_element (self , by : Union [ ByType , RelativeBy ] = By .ID , value : Optional [ str ] = None ) -> WebElement :
42+ def find_element (self , by : str = By .ID , value : str = None ):
4943 """Find an element inside a shadow root given a By strategy and
5044 locator.
5145
@@ -84,7 +78,7 @@ def find_element(self, by: Union[ByType, RelativeBy] = By.ID, value: Optional[st
8478
8579 return self ._execute (Command .FIND_ELEMENT_FROM_SHADOW_ROOT , {"using" : by , "value" : value })["value" ]
8680
87- def find_elements (self , by : Union [ ByType , RelativeBy ] = By .ID , value : Optional [ str ] = None ) -> List [ WebElement ] :
81+ def find_elements (self , by : str = By .ID , value : str = None ):
8882 """Find elements inside a shadow root given a By strategy and locator.
8983
9084 Parameters:
0 commit comments