BrowserTab.is_existing_by_css_selector

def is_existing_by_css_selector(
self,
css_selector: str,
timeout: int = 30
) -> bool

In the active browser, check whether the UI element exist or not by the given CSS selector.

Parameters:
css_selector[Required]: str
   The CSS selector to find the element.
timeout: int
   Timeout for the operation, the unit is second, and the default value is 30 seconds.

Returns:
 Return True if UI element exists, otherwise return False

Example:


from clicknium import clicknium as cc

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

# check element if exist by CSS selector
result = chrome_tab.is_existing_by_css_selector("#sb_form_q")
print(result)

Previousis_existing_by_xpathNextwait_appear

What are your feelings
Updated on 29 August 2023