from pyasli.browsers import browser
browser.base_url = "https://the-internet.herokuapp.com"
browser.open("/disappearing_elements")
element1 = browser.element("div.example p")
assert element1.get_actual() is element1.get_actual(), "Element is found 2 times"
from pyasli.browsers import BrowserSession
with BrowserSession("chrome", base_url="https://the-internet.herokuapp.com") as browser:
browser.open("/disappearing_elements")
element1 = browser.element("div.example p")
assert element1.get_actual() is element1.get_actual(), "Element is found 2 times"
In case browser_instance
is used as context manager, all browser windows will be closed at
exiting context