-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
added frame ruby example #2337
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
added frame ruby example #2337
Conversation
👷 Deploy request for selenium-dev pending review.Visit the deploys page to approve it
|
PR Reviewer Guide 🔍
Here are some key observations to aid the review process:
Redundant Driver
The test creates a new Firefox driver instance despite having a driver already defined in the let block. This could lead to resource leaks if both are used.
driver = Selenium::WebDriver.for :firefox driver.get("https://www.selenium.dev/selenium/web/iframes.html")
Inconsistent Usage
The code locates an iframe by name (iframe1-name) but then switches to the previously defined iframe variable instead of using the newly located element.
iframe1 = driver.find_element(:name, "iframe1-name") # (This line doesn't switch, just locates) driver.switch_to.frame(iframe)
Missing Assertion
After sending keys to email elements, there's no verification that the input was successful before clearing it, reducing test effectiveness.
email_element.send_keys("admin@selenium.dev") email_element.clear
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||
the lint error is in unrelated file of cookie_spec. cannot change it as it will need then change in all document files for cookie. raise another pr for this.
the windows nightly error is also in unrelated file - spec/browsers/internet_explorer_spec.rb
2795b67
into
SeleniumHQ:trunk
Please don't merge if any job is failing.
Also avoid code comments because they are en English and the whole point of having translations is lost.
@diemol i wrote reason for the failing jobs. Kindly read them and let me know .
The reason were unrelated to this that's why I merged.
Please help me understand if it's incorrect?
I will remove comments from code.
I didn't know.
The linter failed because this PR added two blank lines at the beginning of the cookies spec file.
Additionally, the PR broke the build because the referenced file in the markdown was frames_spec.cs instead of frames_spec.rb.
This was not detected in the PR checks because when a PR comes from a fork, it is not possible to use the GITHUB token to render the code examples. Please also run the hugo server command locally to double check the site builds, or create the PR from a branch in this repository (you are a committer and have the rights to do that).
First of all I am sorry to break the build.
I did run Hugo server.
I ran all checks
Saw all errors before I merged
I understand that the file name had incorrect extension and no checks picked it.
I understand I am a committer and I also in my best capacity assure you Diego that I followed all steps of checks but still a mistake happened
I apologise for this @diemol.
I will fix the file extension problem and remove the comments
Beside this if there is any other problem you have found which went pass the checks and I am not aware please kindly let me know.
Thank you for your kind review and time for this .
If you run Hugo server please make sure that you have the token as an environment variable to the code examples are rendered.
The easiest would be to create the PR from a branch in this repository and not your fork.
Oh, and I did fix the lint error and the file name error already. No problem.
Ok Diego @diemol
Thank you for the fix.
I understood what you have mentioned.
Uh oh!
There was an error while loading. Please reload this page.
User description
Thanks for contributing to the Selenium site and documentation!
A PR well described will help maintainers to review and merge it quickly
Before submitting your PR, please check our contributing guidelines.
Avoid large PRs, and help reviewers by making them as simple and short as possible.
Description
added frame ruby example
Motivation and Context
added frame ruby example
Types of changes
Checklist
PR Type
Tests
Description
Added comprehensive Ruby example for iframe interactions
Introduced RSpec test for frame switching and element access
Validated iframe access by id, name, and index
Ensured page content checks and driver cleanup
Changes walkthrough 📝
frames_spec.rb
Add RSpec test for iframe/frame switching in Rubyexamples/ruby/spec/interactions/frames_spec.rb
cookies_spec.rb
Add blank lines for formatting consistencyexamples/ruby/spec/interactions/cookies_spec.rb