Test automation - Building effective solutions

23
Test Automation Building effective solutions by Artem Nagornyi

description

This presentation is answering the questions: how to build an effective test automation framework, select the right tools and organize to whole process?

Transcript of Test automation - Building effective solutions

Page 1: Test automation - Building effective solutions

Test Automation

Building effective solutionsby Artem Nagornyi

Page 2: Test automation - Building effective solutions

select the right tool

In order to understand whether a test automation tool was selected properly, you should begin with answering a few questions:● Is your tool compatible with the application environment,

technologies, and interfaces?● What is the cost of your chosen test automation tool?● How easy it is to write, execute, and maintain test scripts?● Is it possible to extend the tool with additional components?● How fast can a person learn the scripting language used by

the tool?● Is your vendor ready to resolve tool-related issues? Is the

community support strong enough?● How reliable is your test automation tool?

Page 3: Test automation - Building effective solutions

building the framework

Data-driven type of framework with page objects.

Site Class

"Page A" Class "Page B" Class "Page C" Class

Driver

Tests

Helpers

Page 4: Test automation - Building effective solutions

select test cases for automation

How do we select test cases for automation? "Automate them all" is hardly an answer if you are focused on quality and efficiency.

You should automate a manual test case only when:● Your test case is executed frequently enough, and takes

time to run manually. Especially this is actual for large regression test suites.

● You have a test that will run with different sets of data.● Your test case needs to be run under many different

platforms and system configurations.

Page 5: Test automation - Building effective solutions

select test cases for automation

On the other hand, test automation is not recommended in the following cases:

● Usability testing.● When the functionality of the application changes

frequently.● When the expenditures on test automation tools and the

support of already existing tests are too high.● When test automation doesn't provide enough

advantages if compared to manual testing.

Page 6: Test automation - Building effective solutions

test automation lifecycle

Page 7: Test automation - Building effective solutions

sharing the responsibilities

Manual Test Cases

● QA Engineers Test Automation Framework

Development

● TA Engineers● Developers

Automated Test Scripts

Development● QA Engineers● TA Engineers

Execution and Results

Analysis● TA Engineers● QA Engineers

Page 8: Test automation - Building effective solutions

what is selenium webdriver?

● Open-source, multi-platform, multi-browser tool for browser-based Web UI automation that is de facto standard in the world of Web UI test automation.

Page 9: Test automation - Building effective solutions

what is selenium webdriver?

All browsers, all versions are equally supported.

Once written, test script in most cases will work for all browsers without modifications.

Page 10: Test automation - Building effective solutions

what is selenium webdriver?

Test scripts can be developed in any programming language of your preference.

Page 11: Test automation - Building effective solutions

what is selenium webdriver?

Many frameworks are supported:● JUnit● NUnit● TestNG● unittest● RSpec● Test::Unit● Bromine● Robot● FitNesse... and others.

Page 12: Test automation - Building effective solutions

what is selenium webdriver?

Has the biggest and strongest community among all open-source test automation tools.

Page 13: Test automation - Building effective solutions

what is selenium webdriver?

Example of Selenium WebDriver script:

WebDriver driver = new FirefoxDriver();

// Go to the Google Suggest home page

driver.get("http://www.google.com/webhp?complete=1&hl=en");

// Enter the query string "Cheese"

WebElement query = driver.findElement(By.name("q"));

query.sendKeys("Cheese");

Page 14: Test automation - Building effective solutions

what is sikuli?

● Open-source, multi-platform visual technology to automate graphical user interfaces using images of objects on the screen and OCR.

Page 15: Test automation - Building effective solutions

what is sikuli?

Virtually any application interface and platform can be automated. The only requirement is Java.

Page 16: Test automation - Building effective solutions

what is sikuli?

Test scripts can be developed either in Jython or Java.

Page 17: Test automation - Building effective solutions

what is sikuli?

Images of elements can be captured in Sikuli IDE.

Page 18: Test automation - Building effective solutions

what is sikuli?

Example test script in Sikuli:

#Start programcalcApp = App("Calculator")if not calcApp.window(): App.open("calc.exe"); wait(2) calcApp.focus(); wait(1)#Verify that the window appearedif exists("CalcApp.png"): print("PASS: Calculator window appeared")else: print("FAIL: No calculator window")click("2.png"); click("plus.png"); click("3.png")#Verify the addition resultfind("5.png")

Page 19: Test automation - Building effective solutions

what is testng?

TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionalities that make it more powerful and easier to use, such as:● Annotations.● Flexible test configuration.● Support for data-driven testing.● Support for parameters.● Powerful execution model.● Supported by a variety of tools and plug-ins (Eclipse,

IDEA, Maven, etc...).

Page 20: Test automation - Building effective solutions

what is apache ant?

Software tool for automating software build processes.

It can be used for preparing environment, compilation and execution of test scripts if they are developed in Java.

Page 21: Test automation - Building effective solutions

what is jenkins?

Open-source continuous integration server with 300+ plugins to support all kinds of software development.

It can be used to make test automation processes more solid by:● Updating tests from source control repository before

execution.● Scheduling test execution.● Keeping test results and history.

Page 22: Test automation - Building effective solutions

demo

Test automation framework that is built upon the following tools:● Selenium WebDriver● Sikuli● TestNG● Apache Ant● Jenkins

Page 23: Test automation - Building effective solutions

questions?