ui automation

10
UI AUTOMATION Magus Chen http://magustest.com/blog/ [email protected]

Upload: magus-chen

Post on 20-Aug-2015

1.144 views

Category:

Technology


4 download

TRANSCRIPT

Page 1: Ui automation

UI AUTOMATION

Magus Chenhttp://magustest.com/blog/

[email protected]

Page 2: Ui automation

● What is UI Automation

● Common tools and framework

● Selenium2/WebDriver

● Continuous Integration

● Data Driven

● Keyword Driven

● Page Object Pattern

● The Future

Agenda

Page 3: Ui automation

● End to End functional test

● Executed by program

● Verify result by program

● Report defect by program

● Logging for debug

What is UI Automation

Page 4: Ui automation

● Commercial○ HP QuickTest Pro

○ IBM Rational Functional Tester

● Open Source○ Selenium/WebDriver

○ Watir

○ FitNesse

○ Sikuli

Common tools and framework

Page 5: Ui automation

● 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

Page 6: Ui automation

● What is CI

● Glue in UI Automation

● Parallel test execution

Continuous Integration

Page 7: Ui automation

● 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

Page 8: Ui automation

● 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

Page 9: Ui automation

● 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

Page 10: Ui automation

● Parallel

● Run in the cloud

● Example: http://saucelabs.com

The Future