def wait_appear(
self,
locator: Union[_Locator, str],
locator_variables: dict = {},
wait_timeout: int = 30
) -> WebElement
Wait for the specified element of the web page to appear within given timeout.
Remarks:
BrowserTab.wait_appear
is different with clicknium.wait_appear when locating the UI element.
clicknium.wait_appear()
is for both the web and window UI element, and not limited to a specific scope.clicknium.chrome.open("https://bing.com").wait_appear()
will locate element in its parent web page.
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
Wait timeout for the operation, the unit is second, default value is 30 seconds.
Returns:
WebElement object, or None if the element does not appear.
Example:
from clicknium import clicknium as cc, locator
chrome_tab = cc.chrome.open("https://bing.com")
# wait element appear
element = chrome_tab.wait_appear(locator.chrome.bing.search_sb_form_q)
# parametric locator
variables = {"name":"test"}
element = chrome_tab.wait_appear(locator.chrome.bing.search_sb_form_q, variables)