From b6e3ae93319680a0e2c114cedfab8a0a650116fc Mon Sep 17 00:00:00 2001 From: aryanc Date: Sat, 24 Jan 2026 15:06:21 +0530 Subject: [PATCH] Added url refresh due to reoccuring stale element execption --- tests/lt_sample_todo.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/lt_sample_todo.py b/tests/lt_sample_todo.py index 7c40b0a..ac783f5 100644 --- a/tests/lt_sample_todo.py +++ b/tests/lt_sample_todo.py @@ -18,12 +18,14 @@ def load_params_from_json(json_path): @pytest.mark.parametrize("driver", load_params_from_json(str(pathlib.Path(__file__).parent.parent) + "/configurations.json"), indirect=True) def test_title(self, driver): - driver.get(r'https://www.lambdatest.com/selenium-playground/') + driver.get(r'https://www.testmu.ai/selenium-playground/') driver.implicitly_wait(10) + driver.refresh() driver.find_element(By.XPATH, "//a[contains(text(),'Simple Form Demo')]").click() title = driver.current_url assert "simple-form-demo" in title, "tetx is not present n the URL" - val = "Welcome to LambdaTest" + val = "Welcome to TestMu Ai" + time.sleep(2) driver.find_element( By.ID, "user-message").send_keys(val) # driver.find_element(By.XPATH, "//input[@id='user-message']").send_keys(val) driver.find_element(By.ID, "showInput").click() @@ -38,7 +40,9 @@ def test_item(self, driver): :return: None """ - driver.get('https://www.lambdatest.com/selenium-playground/') + driver.get('https://www.testmu.ai/selenium-playground/') + driver.implicitly_wait(10) + driver.refresh() driver.find_element(By.XPATH,"//a[contains(text(),'Drag & Drop Sliders')]").click() time.sleep(2) ActionChains(driver).move_by_offset(946, 349).pause(2).click().perform()