BrowserTab.is_existing_by_xpath

def is_existing_by_xpath(
self,
xpath: str,
timeout: int = 30
) -> bool

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

Parameters:
xpath[Required]: str
   the XPath of the element to find.
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/images")

# check element if exist by XPath
result = chrome_tab.is_existing_by_xpath("//*[@id=\"sb_form_q\"]")
print(result)

Previousis_existingNextis_existing_by_css_selector

What are your feelings
Updated on 29 August 2023