From 8baf02322d299545e3a4c5086f3768bafa8a5183 Mon Sep 17 00:00:00 2001 From: axl89 Date: Fri, 27 May 2016 02:55:15 +0200 Subject: [PATCH] Revert "Temporary workaround to StaleElementReferenceException in PAN3" This reverts commit 066d4ffd8abcbba6fd34fbf11a18747bc15b30d6. --- tests/console/PAN3.py | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/tests/console/PAN3.py b/tests/console/PAN3.py index 5a0f3218cd..0c86ff1d51 100644 --- a/tests/console/PAN3.py +++ b/tests/console/PAN3.py @@ -5,7 +5,6 @@ from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import Select -from selenium.common.exceptions import StaleElementReferenceException class PAN3(PandoraWebDriverTestCase): @@ -41,23 +40,12 @@ class PAN3(PandoraWebDriverTestCase): driver.find_element_by_xpath('//*[@id="menu_tab"]//a[contains(@href,"ver_agente")]').click() element_text = refresh_N_times_until_find_element(driver,5,"table1-1-7",how=By.ID).text - max_retries = 3 - i = 1 - element_text = "" - - while (i <= max_retries): # Temporary workaround to weird StaleElementReferenceException exceptions due Javascript altering the DOM - try: - element_text = refresh_N_times_until_find_element(driver,5,"table1-1-7",how=By.ID).text - self.assertEqual("1", element_text.lstrip().rstrip()) # The lstrip.rstrip is done because if not, this error is raised: "'1' != u'1 '" - except StaleElementReferenceException as e_stale: - i = i+1 - if i > max_retries: - self.verificationErrors.append(str(e)) - break - else: - next - except AssertionError as e: - self.verificationErrors.append(str(e)) + try: + self.assertEqual("1", element_text.lstrip().rstrip()) # The lstrip.rstrip is done because if not, this error is raised: "'1' != u'1 '" + except AssertionError as e: + self.verificationErrors.append(str(e)) + + if __name__ == "__main__": unittest.main()