Skip to content

Commit 76cc800

Browse files
fixed code file
1 parent 5744883 commit 76cc800

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

examples/ruby/spec/interactions/frames_spec.rb

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
require 'spec_helper'
44

55
RSpec.describe 'Frames Test' do
6+
let(:driver) { start_session }
7+
8+
before do
9+
driver.navigate.to 'https://www.selenium.dev/selenium/web/iframes.html'
10+
end
11+
612
it 'interacts with elements inside iframes' do
7-
driver = Selenium::WebDriver.for :chrome
8-
driver.manage.timeouts.implicit_wait = 0.5
9-
10-
# Navigate to URL
11-
driver.get('https://www.selenium.dev/selenium/web/iframes.html')
12-
1313
# Switch to iframe using WebElement
1414
iframe = driver.find_element(id: 'iframe1')
1515
driver.switch_to.frame(iframe)
@@ -38,8 +38,5 @@
3838
# Leave frame
3939
driver.switch_to.default_content
4040
expect(driver.page_source.include?('This page has iframes')).to be true
41-
42-
# Quit the browser
43-
driver.quit
4441
end
4542
end

0 commit comments

Comments
 (0)