Skip to main content

clicknium.wait_appear

def wait_appear( locator: Union[_Locator, str], locator_variables: dict = {}, wait_timeout: int = 30 ) -> UiElement

Wait for the UI element to appear and return it within specified timeout.

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.
wait_timeout: int
Timeout for the waiting to appear, the unit is second, and the default value is 30 seconds.

Returns:
UiElement object, or None if the element does not appear.

Example:


from clicknium import clicknium as cc, locator

#wait element appear
cc.wait_appear(locator.chrome.bing.search_sb_form_q)

#parametric locator
variables = {"name":"test"}
cc.wait_appear(locator.notepad.notepad.document_151, variables)