File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
examples/ruby/spec/interactions Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change 1313# KIND, either express or implied. See the License for the
1414# specific language governing permissions and limitations
1515# under the License.
16-
17-
1816# frozen_string_literal: true
1917
2018require 'spec_helper'
2321 let ( :driver ) { start_session }
2422
2523 it 'performs iframe switching operations' do
26- # Set firefox and launch web page
27- # driver = Selenium::WebDriver.for :firefox
28- driver . get ( 'https://www.selenium.dev/selenium/web/iframes.html' )
24+ driver . navigate . to 'https://www.selenium.dev/selenium/web/iframes.html'
2925 # --- Switch to iframe using WebElement ---
3026 iframe = driver . find_element ( :id , 'iframe1' )
3127 driver . switch_to . frame ( iframe )
3733 driver . switch_to . default_content
3834
3935 # --- Switch to iframe using name or ID ---
40- iframe1 = driver . find_element ( :name , 'iframe1-name' ) # (This line doesn't switch, just locates)
36+ iframe1 = driver . find_element ( :name , 'iframe1-name' )
4137 driver . switch_to . frame ( iframe1 )
4238 expect ( driver . page_source ) . to include ( 'We Leave From Here' )
4339
5349 # --- Final page content check ---
5450 driver . switch_to . default_content
5551 expect ( driver . page_source ) . to include ( 'This page has iframes' )
56-
57- # Quit the driver
58- driver . quit
5952 end
6053end
You can’t perform that action at this time.
0 commit comments