🍺 Join Clicknium for quality support, growth opportunities, and a supportive community

WebElement.find_element

def find_element(
self,
locator: Union[_Locator, str],
locator_variables: dict = {},
timeout: int = 30
) -> WebElement

Return the Web element defined by the given locator.

Parameters:
 locator[Required]: str | _Locator
   locator string, the visit path of locator for target UI element, eg: ‘locator.chrome.bing.search_sb_form_q’, locator store is chrome, and locator name is search_sb_form_q. For more details, please refer to Locator.
 locator_variables: dict
   locator variables, set to initialize parameters in locator, eg: { "row": 1, "column": 1}, more about variables, please refer to Parametric Locator.
 timeout: int
   Timeout for the operation, the unit is second, and the default value is 30 seconds.

Returns:
 WebElement object.

Example:


from clicknium import clicknium as cc, locator

chrome_tab = cc.chrome.open("https://bing.com")

# find element
webelement = chrome_tab.find_element(locator.chrome.bing.search_sb_form_q)

# find sub element
subelement = webelement.find_element(locator.chrome.bing.search_icon)

PreviouschildNextfind_element_by_xpath

What are your feelings
Updated on 29 August 2023