selene
selene copied to clipboard
How to check if browser is open or exit
No way, to understand if browser was use and now open.
Seems like in Selene there is no specific method for that. So you can check this same way as you would do with raw selenium webdriver. As I remember, we usually just check if we can get a title frombrowser.driver
@braunman I have left some thoughts on the topic under #402. Check them for some snippets, like
def is_browser_opened(browser):
try:
return browser.driver.title is not None
except Exception:
return None
# and then use it like:
if browser.get(is_browser_opened):
# do something safely here...
...