Skip to content

Commit 982c416

Browse files
fixed frame code error in java, csharp and python (#2338)
1 parent 3adac7a commit 982c416

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public void TestFrames()
4848

4949

5050
//switch To IFrame using name or id
51-
driver.FindElement(By.Name("iframe1-name"));
51+
IWebElement iframe1=driver.FindElement(By.Name("iframe1-name"));
5252
//Switch to the frame
53-
driver.SwitchTo().Frame(iframe);
53+
driver.SwitchTo().Frame(iframe1);
5454
Assert.AreEqual(true, driver.PageSource.Contains("We Leave From Here"));
5555
IWebElement email = driver.FindElement(By.Id("email"));
5656
//Now we can type text into email field

examples/java/src/test/java/dev/selenium/interactions/FramesTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public void informationWithElements() {
4848

4949

5050
//switch To IFrame using name or id
51-
driver.findElement(By.name("iframe1-name"));
51+
WebElement iframe1=driver.findElement(By.name("iframe1-name"));
5252
//Switch to the frame
53-
driver.switchTo().frame(iframe);
53+
driver.switchTo().frame(iframe1);
5454
assertEquals(true, driver.getPageSource().contains("We Leave From Here"));
5555
WebElement email = driver.findElement(By.id("email"));
5656
//Now we can type text into email field

examples/python/tests/interactions/test_frames.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
# --- Switch to iframe using name or ID ---
3535
iframe1=driver.find_element(By.NAME, "iframe1-name") # (This line doesn't switch, just locates)
36-
driver.switch_to.frame(iframe)
36+
driver.switch_to.frame(iframe1)
3737
assert "We Leave From Here" in driver.page_source
3838

3939
email = driver.find_element(By.ID, "email")

0 commit comments

Comments
 (0)