Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion trigger_freedom_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,9 +294,14 @@ def login(self, username, password):
try: # Wrap core login steps
logger.info("Clicking Log In...")
# Allow potential NoSuchElementException etc. if page structure changes
self.driver.find_element(By.LINK_TEXT, "Log In").click()
self.driver.find_element(By.CSS_SELECTOR, "a.nav_link-login").click()
time.sleep(1) # Small pause after click, might help login form appear

Comment thread
MikolajKawalec marked this conversation as resolved.
# Login now opens a new tab, so we need to switch to it and then continue with the form filling
logger.info("Switching to new login tab...")
# self.driver.window_handles is a list of all open tabs. [-1] gets the newest one.
self.driver.switch_to.window(self.driver.window_handles[-1])
Comment thread
MikolajKawalec marked this conversation as resolved.
Comment thread
MikolajKawalec marked this conversation as resolved.

logger.info("Entering credentials...")
# Add waits for fields to be present before interacting
email_field = WebDriverWait(self.driver, 10).until(
Expand Down
Loading