Skip to content

Blog episode4 selenium community live #2237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions examples/ruby/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ gem 'rake', '~> 13.0'
gem 'rspec', '~> 3.0'
gem 'rubocop', '~> 1.35'
gem 'rubocop-rspec', '~> 3.0'
gem 'selenium-devtools', '= 0.133.0'
gem 'selenium-webdriver', '= 4.29.1'
gem 'selenium-devtools', '= 0.134.0'
gem 'selenium-webdriver', '= 4.30.0'
35 changes: 35 additions & 0 deletions examples/ruby/spec/interactions/frames_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,40 @@
require 'spec_helper'

RSpec.describe 'Frames' do
#set session
let(:driver) { start_session }
let(:wait) { Selenium::WebDriver::Wait.new(timeout: 2) }

it 'interacts with elements inside iframes' do
#navigate to web page
driver.navigate.to 'https://www.selenium.dev/selenium/web/iframes.html'
# Switch to iframe using WebElement
iframe = driver.find_element(id: 'iframe1')
driver.switch_to.frame(iframe)
expect(driver.page_source.include?('We Leave From Here')).to be true

# Interact with email field
email_element = driver.find_element(id: 'email')
email_element.send_keys('admin@selenium.dev')
email_element.clear
driver.switch_to.default_content

# Switch to iframe using name
iframe=driver.find_element(name: 'iframe1-name')
driver.switch_to.frame(iframe)
expect(driver.page_source.include?('We Leave From Here')).to be true

email = driver.find_element(id: 'email')
email.send_keys('admin@selenium.dev')
email.clear
driver.switch_to.default_content

# Switch to iframe using index
driver.switch_to.frame(0)
expect(driver.page_source.include?('We Leave From Here')).to be true

# Leave frame
driver.switch_to.default_content
expect(driver.page_source.include?('This page has iframes')).to be true
end
end
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
title: "Selenium Community Live - Episode 4"
linkTitle: "Selenium Community Live - Episode 4"
date: 2025-03-19
tags: ["webinar", "meetup", "talks","community"]
categories: ["webinar"]
author: <a href="https://www.linkedin.com/in/pallavimuse/" target="_blank">Pallavi Sharma</a>
images:
description: >
Selenium Community Live - Episode 4
---

The fourth episode of Selenium Community Live happened on March 19th, 2025, with speaker **<a href="https://www.linkedin.com/in/mdmintz/" target="_blank">Michael Mintz</a>**, event hosted by **<a href="https://www.linkedin.com/in/pallavimuse/" target="_blank">Pallavi Sharma</a>**

You can watch the episode on YouTube here- **<a href="https://youtube.com/live/FSH712hhHvo?feature=share" target="_blank">Episode 4 on YouTube</a>**
or
You can watch the episode on LinkedIn here- **<a href="https://www.linkedin.com/events/seleniumcommunitylive-episode47301014781094678530/theater/" target="_blank">Episode 4 on LinkedIn</a>**

**Selenium Community Live - Episode 4**

Michael Mintz is creator of Selenium Base, an all in one Browser Automation Framework, built over Selenium WebDriver Python bindings. The framework is well known and used
in the WebDriver Ecosystem community for testing, web scraping, web crawling and stealth purposes.
You can find out more about Selenium Base here - **<a href="https://seleniumbase.io/" target="_blank">Selenium Base</a>**


**Meet the Speakers:**

1. **<a href="https://www.linkedin.com/in/mdmintz/" target="_blank">Michael Mintz</a>**


## Watch the Recording

Couldn’t join us live? Watch the entire episode here -
📹 Recording Link: [Watch the Event Recording on YouTube](https://youtube.com/live/FSH712hhHvo?feature=share)

To know more about Selenium Base, please follow the link
**<a href="https://seleniumbase.io/help_docs/thank_you/" target="_blank">Explore more on Selenium Base</a>**

In case you were wondering what happened to episode 3, it was cancelled but will be scheduled in coming weeks. Thank you!
Stay tuned as we bring the next! **<a href="https://www.youtube.com/@SeleniumHQProject/streams" target="_blank">Subscribe here to the Selenium HQ Official YouTube Channel.</a>**
Original file line number Diff line number Diff line change
Expand Up @@ -88,16 +88,11 @@ driver.find_element(By.TAG_NAME, 'button').click()
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L38-L46" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Store iframe web element
iframe = driver.find_element(:css,'#modal > iframe')

# Switch to the frame
driver.switch_to.frame iframe
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L13-L22" >}}
{{< /tab >}}

# Now, Click on the button
driver.find_element(:tag_name,'button').click
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Store the web element
const iframe = driver.findElement(By.css('#modal > iframe'));
Expand Down Expand Up @@ -140,24 +135,12 @@ driver.find_element(By.TAG_NAME, 'button').click()
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L50-L58" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Switch by ID
driver.switch_to.frame 'buttonframe'

# Now, Click on the button
driver.find_element(:tag_name,'button').click
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Using the ID
await driver.switchTo().frame('buttonframe');

// Or using the name instead
await driver.switchTo().frame('myframe');
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L24-L32" >}}
{{< /tab >}}

// Now we can click the button
await driver.findElement(By.css('button')).click();
{{< /tab >}}
{{< tab header="Kotlin" >}}
{{< tab header="Kotlin" >}}
//Using the ID
driver.switchTo().frame("buttonframe")

Expand All @@ -181,13 +164,20 @@ queried using _window.frames_ in JavaScript.
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/FramesTest.java#L62-L63" >}}
{{< /tab >}}

{{< tab header="Ruby" >}}
# Switch to the second frame
driver.switch_to.frame(1)
{{< tab header="Python" >}}
# missing code

{{< /tab >}}

{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L62-L63" >}}
{{< /tab >}}

{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L34-L36" >}}
{{< /tab >}}


{{< tab header="JavaScript" >}}
// Switches to the second frame
await driver.switchTo().frame(1);
Expand Down Expand Up @@ -217,10 +207,11 @@ driver.switch_to.default_content()
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L66-L67" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Return to the top level
driver.switch_to.default_content
{{< /tab >}}

{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L38-L40" >}}
{{< /tab >}}

{{< tab header="JavaScript" >}}
// Return to the top level
await driver.switchTo().defaultContent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,11 @@ driver.find_element(By.TAG_NAME, 'button').click()
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L38-L46" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Store iframe web element
iframe = driver.find_element(:css,'#modal > iframe')

# Switch to the frame
driver.switch_to.frame iframe
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L13-L22" >}}
{{< /tab >}}

# Now, Click on the button
driver.find_element(:tag_name,'button').click
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Store the web element
const iframe = driver.findElement(By.css('#modal > iframe'));
Expand Down Expand Up @@ -118,16 +113,24 @@ FrameまたはiFrameにidまたはname属性がある場合、代わりにこれ
{{< tab header="Java" text=true >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/FramesTest.java#L50-L58" >}}
{{< /tab >}}

{{< tab header="Python" >}}
# Switch frame by id
driver.switch_to.frame('buttonframe')

# Now, Click on the button
driver.find_element(By.TAG_NAME, 'button').click()
{{< /tab >}}

{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L50-L58" >}}
{{< /tab >}}

{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L24-L32" >}}
{{< /tab >}}


{{< tab header="JavaScript" >}}
// Using the ID
await driver.switchTo().frame('buttonframe');
Expand Down Expand Up @@ -158,20 +161,24 @@ JavaScriptの _window.frames_ を使用して照会できるように、Frameの
{{< tab header="Java" text=true >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/FramesTest.java#L62-L63" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Switch to the second frame
driver.switch_to.frame(1)
{{< /tab >}}
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L62-L63" >}}
{{< /tab >}}
{{< tab header="Python" >}}

{{< tab header="Python" >}}
# switching to second iframe based on index
iframe = driver.find_elements(By.TAG_NAME,'iframe')[1]

# switch to selected iframe
driver.switch_to.frame(iframe)
{{< /tab >}}

{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L62-L63" >}}
{{< /tab >}}

{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L34-L36" >}}
{{< /tab >}}


{{< tab header="JavaScript" >}}
// Switches to the second frame
await driver.switchTo().frame(1);
Expand All @@ -198,10 +205,11 @@ driver.switch_to.default_content()
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L66-L67" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Return to the top level
driver.switch_to.default_content
{{< /tab >}}

{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L38-L40" >}}
{{< /tab >}}

{{< tab header="JavaScript" >}}
// Return to the top level
await driver.switchTo().defaultContent();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,9 @@ driver.find_element(By.TAG_NAME, 'button').click()
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L38-L46" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Store iframe web element
iframe = driver.find_element(:css,'#modal > iframe')

# Switch to the frame
driver.switch_to.frame iframe

# Now, Click on the button
driver.find_element(:tag_name,'button').click
{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L13-L22" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Store the web element
const iframe = driver.findElement(By.css('#modal > iframe'));
Expand Down Expand Up @@ -136,23 +129,12 @@ driver.find_element(By.TAG_NAME, 'button').click()
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L50-L58" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Switch by ID
driver.switch_to.frame 'buttonframe'

# Now, Click on the button
driver.find_element(:tag_name,'button').click
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Using the ID
await driver.switchTo().frame('buttonframe');

{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L24-L32" >}}
{{< /tab >}}

// Or using the name instead
await driver.switchTo().frame('myframe');

// Now we can click the button
await driver.findElement(By.css('button')).click();
{{< /tab >}}
{{< tab header="Kotlin" >}}
//Using the ID
driver.switchTo().frame("buttonframe")
Expand All @@ -174,20 +156,23 @@ consultado usando _window.frames_ em JavaScript.
{{< tab header="Java" text=true >}}
{{< gh-codeblock path="examples/java/src/test/java/dev/selenium/interactions/FramesTest.java#L62-L63" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Switch to the second frame
driver.switch_to.frame(1)
{{< /tab >}}
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L62-L63" >}}
{{< /tab >}}
{{< tab header="Python" >}}
{{< tab header="Python" >}}
# switching to second iframe based on index
iframe = driver.find_elements(By.TAG_NAME,'iframe')[1]

# switch to selected iframe
driver.switch_to.frame(iframe)
{{< /tab >}}

{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L62-L63" >}}
{{< /tab >}}

{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L34-L36" >}}
{{< /tab >}}


{{< tab header="JavaScript" >}}
// Switches to the second frame
await driver.switchTo().frame(1);
Expand Down Expand Up @@ -215,10 +200,9 @@ driver.switch_to.default_content()
{{< tab header="CSharp" text=true >}}
{{< gh-codeblock path="examples/dotnet/SeleniumDocs/Interactions/FramesTest.cs#L66-L67" >}}
{{< /tab >}}
{{< tab header="Ruby" >}}
# Return to the top level
driver.switch_to.default_content
{{< /tab >}}
{{< tab header="Ruby" text=true >}}
{{< gh-codeblock path="examples\ruby\spec\interactions\frames_spec.rb#L38-L40" >}}
{{< /tab >}}
{{< tab header="JavaScript" >}}
// Return to the top level
await driver.switchTo().defaultContent();
Expand Down
Loading
Loading