From 31d1af42ae233c98a23e709930bd30dcaa1e0eac Mon Sep 17 00:00:00 2001 From: timelyart Date: Tue, 19 Feb 2019 14:23:19 +0100 Subject: [PATCH] Fixed: inconsistent error on login "Message: unknown error: Element [...] is not clickable at point (1085, 97). Other element would receive the click: [...] --- tv/tv.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tv/tv.py b/tv/tv.py index a790e3e..696a2fb 100644 --- a/tv/tv.py +++ b/tv/tv.py @@ -641,7 +641,7 @@ def retry_take_screenshot(browser, symbol, interval, retry_number=0): browser.refresh() # Switching to Alert try: - alert = browser.switch_to_alert() + alert = browser.switch_to.alert() alert.accept() time.sleep(5) except NoAlertPresentException: @@ -951,7 +951,7 @@ def retry(browser, alert_config, timeframe, interval, ticker_id, screenshot_url, log.info('Trying again (' + str(retry_number+1) + ')') browser.refresh() # Switching to Alert - alert = browser.switch_to_alert() + alert = browser.switch_to.alert() alert.accept() time.sleep(5) # change symbol @@ -1073,8 +1073,7 @@ def login(browser, uid='', pwd='', retry_login=False): exit(0) try: - wait_and_click(browser, css_selectors['username']) - elem_username = browser.find_element_by_css_selector(css_selectors['username']) + elem_username = wait_and_get(browser, css_selectors['username']) if type(elem_username) is WebElement and elem_username.get_attribute('textContent') != '' and elem_username.get_attribute('textContent') == uid: TV_UID = uid TV_PWD = pwd