-
Overview
-
Architecture
-
Focus on the User
- The WebDriver APIs are focused on driving the browser from the user's point of view.
- e.g. "getText" attempts to return the text as a user would see it
-
Layered
- API Wrapper
- Drivers for different browsers
-
Getting Started
- Start
-
Next Steps
- Navigating
- Interacting with the Page
- Filling in Forms
- Visual Information and Drag And Drop
- Moving between Windows and Frames
- Navigation: history and location
- Cookies
-
Drivers
-
HtmlUnitDriver
- Pure Java Implementation
- Platform Independent
- Support JavaScript
-
IE
- Slow
- Windows
-
Required configuration
- IE7 Protected Mode
- 100% Zoom
- Firefox
- Mobile
-
API
-
Interactions
- Check out interactions in WebElement API
- Advanced Interactions (Dev In Progress)
-
Ajax Request
- Check Element Status Change
- Use JavascriptExecutor to check JavaScript status variable
- When use page objects, use AjaxElementLocatorFactory to wait elements for a certain time.
-
Waiter
-
explicit wait
-
Document
- WebDriverWait
- Function
- Example
-
implicit wait
- driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS)
- when using findElement it will wait implicitly until the element presents
- API
-
Supported Locators
- XPath
- CSSSelector
- id, name, etc
-
Language Support
- Java
- Ruby
-
Development Strategies
-
Domain Driven Design
- Ubiquitous Language (Business Language)
-
BotStyle
- It's possible to layer PageObjects on top of bots.
-
Page Objects
-
Benefits
- Reduce Duplicated Code
- Fix need only be applied in one place
-
Design
- The public methods represent the services that the page offers
- Try not to expose the internals of the page
- Generally don't make assertions
- Methods return other PageObjects
- Need not represent an entire page, could be part of a page, e.g. site navigation.
- Different results for the same action are modelled as different methods, e.g. successLogin, failedLogin
- Check current page by comparing title, see example.
-
Page Factory
- Help to initElements, this is very useful.
-
LoadableComponent
- Improve of Page Objects, do not need to load page explicitly any more
-
Integrate With Cuke4duke
-
Page Objects
-
What's difference when integrate with cuke4duke?
- Should have assert in page objects
- Do not need return any page objects in methods
- Check out cuke-webdriver-demo in github
-
picocontainer
- Used for DI of pages
-
Others
- WebElement VS RenderedWebElement
- Selenium Emulation (WebDriver backed Selenium API)
- WebDriver VS Selenium
- WebDriver & Maven
- Automation Atoms
- How does WebDriver deal with untrusted SSL
-
WebDriver Grid (Same as Selenium Grid)
- Hug
- Node
-
Remote
- Client
- Server
- Wire Protocol