27
Automation and Selenium Author: QuỳnhKT – FSU1.BU9

Selenium

Embed Size (px)

DESCRIPTION

Tài liệu học Selenium

Citation preview

  • Automation and SeleniumAuthor: QunhKT FSU1.BU9

  • AgendaAutomation OverviewWhat is Automation?Why automate?Which Test Cases to Automate? Which Test Cases to Automate? Benefit and limitationSeleniumWhat is it?Selenium componentsTestNG OverviewWhat is TestNG?Why do we need TestNG in Selenium?Why do we need TestNG in Selenium?Demo*

  • What is Automation testing?*Manual testing is performed by a human sitting in front of a computer carefully executing the test steps. Automation Testing means using an automation tool to execute your test case suite. The automation software can also enter test data into the System Under Test , compare expected and actual results and generate detailed test reports.

  • Why automate*Manual Testing of all work flows, all fields , all negative scenariosis time and cost consumingIt is difficult to test for multi lingual sites manuallyAutomation does not require Human intervention. You can run automated test unattended (overnight)Automation increases speed of test executionAutomation helps increase Test CoverageManual Testing can become boring and hence error prone.

  • Which Test Cases to Automate?High Risk - Business Critical test casesTest cases that are executed repeatedlyTest Cases that are very tedious or difficult to perform manuallyTest Cases which are time consuming*

  • Which is not suitable for automation*Test Cases that are newly designed and not executed manually at least onceTest Cases for which the requirements are changing frequentlyTest cases which are executed on ad-hoc basis.

  • Benefits and limitationBenefitRegression test on a new versionRun more test more oftenDifficult to do manuallyBig data casesOptimize resourcesIncrease confidenceLimitationCant replace manual testingFind less bugs than manual testMaintenance time may be more costly than manual testTechnical problem

    *

  • Automation test process*

  • *Selenium

    What is it?Selenium component

  • Selenium What is it?

    Developed by ThoughtWorks and Google Selenium is a set of tools to automate web application testing across many platforms. Selenium runs in many browsers and operating systems. Support many languages, including Ruby, Python, Java, c# and so on Selenium is an Open Source project. The code can be modified and enhancements can be submitted for contribution.

  • Selenium ComponentsSelenium IDESelenium RCSelenium GridWebDriver (Selenium 2.0)*

  • Selenium IDE*Selenium IDE (Integrated Development Environment) is the simplest tool in the Selenium Suite.It isa Firefox add-on that creates tests very quickly through its record-and-playback functionality

  • Selenium IDE*

  • Selenium RC*Allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser.

  • Selenium RC*

  • Selenium WebDriver*WebDriver is a web automation framework that allows you toexecute your tests against different browsers, not just Firefox (unlike Selenium IDE).WebDriver also enables you touse a programming languagein creating your test scripts(not possible in Selenium IDE).

  • Selenium Webdriver*

  • Selenium Grid*

  • Selenium GridAllows you run the tests on different machines against different browsers in parallel; in other words it enables distributed test execution. Run your tests against different browsers, operating systems, and machines all at the same time.Save time in execution of your test suites.*

  • What is TestNG?TestNG is an open source automated testing framework; where NG of TestNG means Next Generation. TestNG is similar to JUnit (especially JUnit 4), but its not a JUnit extension. Its inspired by JUnit. It is designed to be better than JUnit, especially when testing integrated classes.*

  • Advantages of TestNG over JUnitThere are three major advantages of TestNG over JUnit: Annotations are easier to understandTest cases can be grouped more easilyParallel testing is possible*

  • Advantages of TestNG over JUnit*

  • Why do we need TestNG in Selenium?*TestNG can generate reports based on our Selenium test results.WebDriver has no native mechanism for generating reports.TestNG can generate the report in a readable format like the one shown below.

  • Why do we need TestNG in Selenium?*TestNG simplifies the way the tests are coded There is no more need for a static main method in our tests. The sequence of actions is regulated by easy-to-understand annotations that do not require methods to be static.Uncaught exceptions are automatically handled by TestNG without terminating the test prematurely. These exceptions are reported as failed steps in the report.

  • *

  • *

  • Thank you!

    **********