Test Automation
Building effective solutionsby Artem Nagornyi
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?
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
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.
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.
test automation lifecycle
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
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.
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.
what is selenium webdriver?
Test scripts can be developed in any programming language of your preference.
what is selenium webdriver?
Many frameworks are supported:● JUnit● NUnit● TestNG● unittest● RSpec● Test::Unit● Bromine● Robot● FitNesse... and others.
what is selenium webdriver?
Has the biggest and strongest community among all open-source test automation tools.
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");
what is sikuli?
● Open-source, multi-platform visual technology to automate graphical user interfaces using images of objects on the screen and OCR.
what is sikuli?
Virtually any application interface and platform can be automated. The only requirement is Java.
what is sikuli?
Test scripts can be developed either in Jython or Java.
what is sikuli?
Images of elements can be captured in Sikuli IDE.
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")
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...).
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.
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.
demo
Test automation framework that is built upon the following tools:● Selenium WebDriver● Sikuli● TestNG● Apache Ant● Jenkins
questions?