in modules/browser_object_tabbar.py [0:0]
def get_tab(self, identifier: Union[str, int]) -> Union[WebElement, None]:
"""Return a tab root based on either a title or an index"""
if isinstance(identifier, int):
tab = self.get_element("tab-by-index", labels=[str(identifier)])
elif isinstance(identifier, str):
tab = self.get_element("tab-by-title", labels=[identifier])
else:
# if we get an unexpected type, we shouldn't assume that the user wants sys exit,
# but we have to cause problems for them nonetheless
assert False, "Error getting tab root"
return tab