-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Automation Atoms
Browser Automation Atoms are building blocks intended to be used by Selenium implementations. By using the same pieces throughout the codebase, rather than reimplementing required functionality in multiple places, the project can reduce the number of bugs found, and can simplify the process of adding new functionality and drivers.
There are two ways to make use of the automation atoms.
- Using Google Closure
- As compiled fragments
The first of these approaches is useful when constructing a monolithic application, such as Selenium Core. The second approach is used in those drivers that are implemented natively and wish to use the atoms to interrogate the DOM (such as the InternetExplorerDriver).
If you're developing the Atoms, then the easiest way to test them is:
# Start the server
./go debug-server &
Now point a browser at http://localhost:2310/javascript/atoms/test and select the test you'd like to run. As you edit the atoms, so long as you don't change the "goog.require" or "goog.provides" statements then you can just refresh the page to see the tests run with your changes. If you do change either of those settings, kill the server and then run
./go calcdeps
./go debug-server &
Each of the atoms listed here is exposed via the list method name, which delegates directly through to the implementation method. For information about the order in which arguments are to be passed, and for additional documentation, view the jsdoc of the implementation method.
Method Name | Description | Implementation Method |
---|---|---|
clear | ||
click | ||
executeScript | ||
findElement | Find the first matching element in the DOM | bot.locators.findElement |
findElements | Find all matching elements in the DOM | bot.locators.findElements |
fire | Fire a specific, synthesized event | bot.events.fire |
getAttribute | Get the value of an attribute or property of an element | bot.dom.getAttribute |
getLocation | Get the absolute location of an element in the DOM | bot.dom.getLocation |
getSize | Get the size of an element | bot.dom.getSize |
isDisplayed | ||
isEnabled | ||
isSelected | Would a user consider this element selected? | bot.dom.isSelected |
setSelected | ||
submit | ||
toggle | ||
type |
The canonical list of atoms that are implemented for the webdriver APIs are located in this build file. The names of the js_fragment
rules relate to the names of the methods.
This wiki is not where you want to be! Visit the Wiki Home for more useful links
Getting Involved
Build Instructions
Releasing Selenium
Updating Chromium DevTools
Ruby Development
Python Bindings
Ruby Bindings
WebDriverJs
This content is being evaluated for where it belongs
Architectural Overview
Automation Atoms
HtmlUnitDriver
Lift Style API
LoadableComponent
Logging
PageFactory
RemoteWebDriver
Xpath In WebDriver
Moved to Official Documentation
Bot Style Tests
Buck
Continuous Integration
Crazy Fun Build
Design Patterns
Desired Capabilities
Developer Tips
Domain Driven Design
Firefox Driver
Firefox Driver Internals
Focus Stealing On Linux
Frequently Asked Questions
Google Summer Of Code
Grid Platforms
History
Internet Explorer Driver
InternetExplorerDriver Internals
Next Steps
PageObjects
RemoteWebDriverServer
Roadmap
Scaling WebDriver
SeIDE Release Notes
Selenium Emulation
Selenium Grid 4
Selenium Help
Shipping Selenium 3
The Team
TLC Meetings
Untrusted SSL Certificates
WebDriver For Mobile Browsers
Writing New Drivers