Skip to content

Commit c7ed8f2

Browse files
fixed error of quit
1 parent bd87120 commit c7ed8f2

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

examples/ruby/spec/interactions/frames_spec.rb

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
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

2018
require 'spec_helper'
@@ -23,9 +21,7 @@
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)
@@ -37,7 +33,7 @@
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

@@ -53,8 +49,5 @@
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
6053
end

0 commit comments

Comments
 (0)