
Security News
Follow-up and Clarification on Recent Malicious Ruby Gems Campaign
A clarification on our recent research investigating 60 malicious Ruby gems.
selenium-webdriver-element-decorators
Advanced tools
= Selenium 2.0 (WebDriver) Element Decorators
This package implements a set of decorator classes for WebElement's of Selenium 2.0 (WebDriver). They add specific behavoiur to various elements of web interface that allow to write more readable automation scripts. Decorators provide all the same methods as original WebElement, but adds several new methods to deal with forms, selects, checkboxes etc.
== Sample
require ''
browser = Browser.new :firefox
browser.navigate.to 'http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_PASSWORD.html'
form = browser.find_element(:id => 'content').find_element(:tag_name => 'form')
form.populate 'realname' => 'John Smith', 'mypassword' => 'qwerty'
form.submit
browser.navigate.to 'http://www.htmlcodetutorial.com/forms/_SELECT_MULTIPLE.html'
form = browser.find_element(:id => 'content').find_element(:tag_name => 'form')
select = form.find_element :name => 'toppings'
select.select_by_value ['greenpeppers', 'tomatoes']
form.submit
== Why Decorators?
Yes, it was possible to inject new methods right inside WebElement class. But decorator pattern looks more suitable because it allows to distinguish web elements of different kind. One may use is_a? method to check their type, and only specific methods are added to each decorator class. What would 'populate' method mean for a button, or 'append' method for an element other than text input field (or password, or text area)?
Decorators reimplement 'find_element' and 'find_elements' methods. They make an attempt to recognize type of each found element and automatically decorate it according to its type.
== Contributing to selenium-webdriver-element-decorators
== Copyright
Copyright (c) 2011 Alexei Barantsev. See LICENSE.txt for further details.
FAQs
Unknown package
We found that selenium-webdriver-element-decorators demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.
Research
/Security News
A malicious Go module posing as an SSH brute forcer exfiltrates stolen credentials to a Telegram bot controlled by a Russian-speaking threat actor.