ui automation
TRANSCRIPT
● What is UI Automation
● Common tools and framework
● Selenium2/WebDriver
● Continuous Integration
● Data Driven
● Keyword Driven
● Page Object Pattern
● The Future
Agenda
● End to End functional test
● Executed by program
● Verify result by program
● Report defect by program
● Logging for debug
What is UI Automation
● Commercial○ HP QuickTest Pro
○ IBM Rational Functional Tester
● Open Source○ Selenium/WebDriver
○ Watir
○ FitNesse
○ Sikuli
Common tools and framework
● Two sophisticated browser automation frameworks are
merged
○ http://seleniumhq.org/
○ http://code.google.com/p/selenium/
● Pros
○ APIs in popular languages
○ Multi-Browser and Multi-OS
○ Support many test frameworks
○ Support AJAX
Selenium2/WebDriver
● What is CI
● Glue in UI Automation
● Parallel test execution
Continuous Integration
● Test data + re-usable test logic
Test data:
Test logic:○ Navigate to target page○ Fetch test data○ Enter title and description○ Submit form○ Verify result
Data Driven
Fields Data set 1 Data set 2
Title test title one long title
Description simple desc unicode desc
● Based on data driven
● Separate the test script developer and test case designer
Keyword Driven
Object Action Data Comment
signin_username input [email protected] username
signin_password input password
signin_btn click page refresh
page_title check Login successfully
● Reuse test code and reduce duplication
● Readable test code
● Focus on "What to do" instead of "How to do"
● Expose method that represent an element that can be seen and
can be operated on the page
Page Object Pattern
driver.findElement(By.id("user")).sendKeys("magus");driver.findElement(By.id("pwd")).sendKeys("password");driver.findElement(By.id("submit")).click()
login_page.login("magus", "password")VS
● Parallel
● Run in the cloud
● Example: http://saucelabs.com
The Future