diff --git a/examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs b/examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs index 85f7573c883..4a0daa471c5 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 b6ff81ae052..8a11a3e00df 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 9a1b21fa16e..3ce9d1a3192 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")