From 608449403ae9aebcf42afef4ccb6182fbef07522 Mon Sep 17 00:00:00 2001 From: pallavigotwork Date: Mon, 9 Jun 2025 12:16:32 +0530 Subject: [PATCH] fixed frame code error in java, csharp and python --- examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs | 4 ++-- .../src/test/java/dev/selenium/interactions/FramesTest.java | 4 ++-- examples/python/tests/interactions/test_frames.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs b/examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs index 85f7573c883f..4a0daa471c5a 100644 --- a/examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs +++ b/examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs @@ -48,9 +48,9 @@ public void TestFrames() //switch To IFrame using name or id - driver.FindElement(By.Name("iframe1-name")); + IWebElement iframe1=driver.FindElement(By.Name("iframe1-name")); //Switch to the frame - driver.SwitchTo().Frame(iframe); + driver.SwitchTo().Frame(iframe1); Assert.AreEqual(true, driver.PageSource.Contains("We Leave From Here")); IWebElement email = driver.FindElement(By.Id("email")); //Now we can type text into email field diff --git a/examples/java/src/test/java/dev/selenium/interactions/FramesTest.java b/examples/java/src/test/java/dev/selenium/interactions/FramesTest.java index b6ff81ae052f..8a11a3e00df9 100644 --- a/examples/java/src/test/java/dev/selenium/interactions/FramesTest.java +++ b/examples/java/src/test/java/dev/selenium/interactions/FramesTest.java @@ -48,9 +48,9 @@ public void informationWithElements() { //switch To IFrame using name or id - driver.findElement(By.name("iframe1-name")); + WebElement iframe1=driver.findElement(By.name("iframe1-name")); //Switch to the frame - driver.switchTo().frame(iframe); + driver.switchTo().frame(iframe1); assertEquals(true, driver.getPageSource().contains("We Leave From Here")); WebElement email = driver.findElement(By.id("email")); //Now we can type text into email field diff --git a/examples/python/tests/interactions/test_frames.py b/examples/python/tests/interactions/test_frames.py index 9a1b21fa16e6..3ce9d1a31923 100644 --- a/examples/python/tests/interactions/test_frames.py +++ b/examples/python/tests/interactions/test_frames.py @@ -33,7 +33,7 @@ # --- Switch to iframe using name or ID --- iframe1=driver.find_element(By.NAME, "iframe1-name") # (This line doesn't switch, just locates) -driver.switch_to.frame(iframe) +driver.switch_to.frame(iframe1) assert "We Leave From Here" in driver.page_source email = driver.find_element(By.ID, "email")