File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed
dotnet/SeleniumDocs/Interactions
java/src/test/java/dev/selenium/interactions
python/tests/interactions Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,9 @@ public void TestFrames()
48
48
49
49
50
50
//switch To IFrame using name or id
51
- driver . FindElement ( By . Name ( "iframe1-name" ) ) ;
51
+ IWebElement iframe1 = driver . FindElement ( By . Name ( "iframe1-name" ) ) ;
52
52
//Switch to the frame
53
- driver . SwitchTo ( ) . Frame ( iframe ) ;
53
+ driver . SwitchTo ( ) . Frame ( iframe1 ) ;
54
54
Assert . AreEqual ( true , driver . PageSource . Contains ( "We Leave From Here" ) ) ;
55
55
IWebElement email = driver . FindElement ( By . Id ( "email" ) ) ;
56
56
//Now we can type text into email field
Original file line number Diff line number Diff line change @@ -48,9 +48,9 @@ public void informationWithElements() {
48
48
49
49
50
50
//switch To IFrame using name or id
51
- driver .findElement (By .name ("iframe1-name" ));
51
+ WebElement iframe1 = driver .findElement (By .name ("iframe1-name" ));
52
52
//Switch to the frame
53
- driver .switchTo ().frame (iframe );
53
+ driver .switchTo ().frame (iframe1 );
54
54
assertEquals (true , driver .getPageSource ().contains ("We Leave From Here" ));
55
55
WebElement email = driver .findElement (By .id ("email" ));
56
56
//Now we can type text into email field
Original file line number Diff line number Diff line change 33
33
34
34
# --- Switch to iframe using name or ID ---
35
35
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 )
37
37
assert "We Leave From Here" in driver .page_source
38
38
39
39
email = driver .find_element (By .ID , "email" )
You can’t perform that action at this time.
0 commit comments