Selenium HP Web Test Tool Training

Slides:



Advertisements
Similar presentations
JUnit Tutorial Hong Qing Yu Nov JUnit Tutorial The testing problems The framework of JUnit A case study JUnit tool Practices.
Advertisements

J-Unit Framework.
Unit and Functional Testing with JUnit and Related Tools Greg Barnes University of Washington
Objectives: Test Options JUnit Testing Framework TestRunners Test Cases and Test Suites Test Fixtures JUnit.
JUnit test distribution Bettina Scharpf ACM 2 University of Applied Science Furtwangen.
JUnit. What is unit testing? A unit is the smallest testable part of an application. A unit test automatically verifies the correctness of the unit. There.
S Ramakrishnan1 Systems V & V, Quality and Standards Dr Sita Ramakrishnan School CSSE Monash University.
JUnit Syed Nabeel. Motivation Unit Testing Responsibility of  developer Rarely done properly Developers Excuse: “I am too much in a hurry”
JUnit Introduction and Advanced Features. Topics Covered  Junit Introduction  Fixtures  Test Suites  Currency Example.
24-Jun-15 JUnit. 2 Test suites Obviously you have to test your code to get it working in the first place You can do ad hoc testing (running whatever tests.
Presentation Outline What is JUnit? Why Use JUnit? JUnit Features Design of JUnit Downloading JUnit Writing Tests – TestCase – TestSuite Organizing The.
Unit Testing Discussion C. Unit Test ● public Method is smallest unit of code ● Input/output transformation ● Test if the method does what it claims ●
George Blank University Lecturer. JUnit for Test Driven Development By Vivek Bhagat, George Blank.
Automated Testing Nathan Weiss April 23, Overview History of Testing Advantages to Automated Testing Types of Automated Testing Automated Testing.
The Design of JUnit Yonglei Tao. Test-First Development  An essential element in eXtreme Programming (XP)  Test is written before the code  As an executable.
Lesson 7 Unit Testing /JUnit/ AUBG ICoSCIS Team Assoc. Prof. Stoyan Bonev March, , 2013 SWU, Blagoevgrad.
Concordia University Department of Computer Science and Software Engineering Click to edit Master title style ADVANCED PROGRAMMING PRACTICES Unit Testing.
XUnit.net Extensibility Brad Wilson Jim Newkirk. Schedule Assert Extensibility9:00 Before/After Extensibility9:45 Fact Extensibility10:15 BREAK10:45 Fixture.
JUnit The framework. Goal of the presentation showing the design and construction of JUnit, a piece of software with proven value.
Lecture 6 Software Testing and jUnit CS140 Dick Steflik.
Table-Driven Acceptance Testing Mario Aquino Principal Software Engineer Object Computing, Inc.
M Gallas CERN EP-SFT LCG-SPI: SW-Testing1 LCG-SPI: SW-Testing LCG Applications Area GridPP 7 th Collaboration Meeting LCG/SPI LCG.
Computer Science and Engineering College of Engineering The Ohio State University JUnit The credit for these slides goes to Professor Paul Sivilotti at.
Testing in Extreme Programming
DbUnit Framework Joe Borosky Chris DeCelles Yvonne Krashkevich.
JUnit & Eclipse1 DEPARTMENT OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING CONCORDIA UNIVERSITY Feb 2, 2009 revision 1.2 – Feb 2, 2009 by Emil Vassev & Joey.
Introduction to JUnit 3.8 SEG 3203 Winter ‘07 Prepared By Samia Niamatullah.
JUnit Dwight Deugo Nesa Matic
LCG-SPI: SW-Testing LCG AppArea internal review (20/10/03)
Unit Testing with JUnit and Clover Based on material from: Daniel Amyot JUnit Web site.
JUnit Dwight Deugo Nesa Matic
A tool for test-driven development
Simple Java Unit Testing with JUnit 4 and Netbeans 6.1 Kiki Ahmadi JUG-Bonek.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
CSCA48H Style and Testing. 2 Style The Zen of Python: import this Do the Goodger reading!
JUnit Jumpstart © Manning Publications.
EMBEDDED REAL-TIME, INC. December 8, 2015 Java Unit Mark Mosher Rochester Java Users Group.
JUnit Don Braffitt Updated: 10-Jun-2011.
JUnit Eclipse, Java and introduction to Junit. Topics Covered  Using Eclipse IDE  Example Java Programs  Junit Introduction.
JUnit A framework which provides hooks for easy testing of your Java code, as it's built Note: The examples from these slides can be found in ~kschmidt/public_html/CS265/Labs/Java/Junit.
S Ramakrishnan1 Systems V & V, Quality and Standards Dr Sita Ramakrishnan School CSSE Monash University.
Unit, Regression, and Behavioral Testing Based On: Unit Testing with JUnit and CUnit by Beth Kirby Dec 13, 2002 Jules.
Test a Little, Code a Little Colin Sharples IBM Global Services New Zealand Colin Sharples IBM Global Services New Zealand.
Unit Testing with FlexUnit
1 JUnit. 2 Unit Testing with JUnit If code has no automated test case written for it to prove that it works, it must be assumed not to work. An API that.
Topic: Junit Presenters: Govindaramanujam, Sama & Jansen, Erwin.
Test Automation For Web-Based Applications Portnov Computer School Presenter: Ellie Skobel.
Automated Testing with PHPUnit. How do you know your code works?
Getting Started with JUnit Getting Started with JUnit The benefits and ease of writing and running JUnit test cases and test suites. The benefits and ease.
SWE 434 SOFTWARE TESTING AND VALIDATION LAB2 – INTRODUCTION TO JUNIT 1 SWE 434 Lab.
Object Oriented Testing (Unit Testing)
Advanced programming Practices
CompSci 280 S Introduction to Software Development
Selenium HP Web Test Tool Training
Software Construction Lab 10 Unit Testing with JUnit
Don Braffitt Updated: 26-Mar-2013
Test Automation CS 4501 / 6501 Software Testing
Unit testing Java programs Using JUnit
Test Driven Development 1 November Agenda  What is TDD ?  Steps to start  Refactoring  TDD terminology  Benefits  JUnit  Mocktio  Continuous.
Computer Science 209 Testing With JUnit.
An Automated Testing Framework
Selenium HP Web Test Tool Training
Test Automation For Web-Based Applications
History, Characteristics and Frameworks
Joe Borosky Chris DeCelles Yvonne Krashkevich
Introduction to JUnit CS 4501 / 6501 Software Testing
Test Automation CS 4501 / 6501 Software Testing
More JUnit CS 4501 / 6501 Software Testing
Introduction to JUnit IT323 – Software Engineering II
JUnit Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from the Eclipse 3.0 and.
Presentation transcript:

Selenium HP Web Test Tool Training Portnov Computer School Selenium HP Web Test Tool Training Test Automation For Web-Based Applications Presenter: Ellie Skobel

Day 1 Unittest Basics

Unittest A Python language version of JUnit Also referred to as PyUnit xUnit frameworks are available for: ASP, C++, C#, Eiffel, Delphi, Perl, PHP, Python, REBOL, Smalltalk, and Visual Basic A Python language version of JUnit Also referred to as PyUnit Created in 1997 by Erich Gamma and Kent Beck Erich Gamma - well known as one of the “Gang of Four” who gave us the now classic Design Patterns book. Kent Beck is equally well known for his groundbreaking work in the software discipline known as Extreme Programming The underlying testing model (xUnit) is on its way to becoming the standard framework for any language.

Framework A semi-complete application. Provides a reusable, common structure that can be shared between applications. Developers incorporate the framework into their own application and extend it to meet their specific needs. Differs from toolkits by providing a coherent structure, rather than a simple set of utility classes.

Unit Test Examines the behavior of a distinct unit of work A unit of work is a task that is not directly dependent on the completion of any other task. In a Unit Testing framework: Each unit test must run independently of all other unit tests. Errors must be detected and reported test by test. It must be easy to define which unit tests will run.

Unittest Features test fixture test case test suite test runner preparation needed to perform one or more tests, any associate cleanup test case smallest unit of testing. It checks for a specific response to a particular set of inputs unittest provides a base class, TestCase, which may be used to create new test cases test suite collection of test cases, test suites, or both used to aggregate tests that should be executed together test runner component which executes tests and reports the result.

Creating Test Cases A test case is created by sub-classing unittest.TestCase Individual tests are defined with method names that start with the letters 'test'. This naming convention informs the test runner about which methods represent tests. class AutoSuggest is a subclass of unittest.TestCase Name of a method which defines a testcase, starts with 'test'

setUp() and tearDown() methods are for preperation and cleanup Writing a Test Cases The setUp() and tearDown() methods allow you to define instructions that will be executed before and after each test method. Individual tests are defined with method names that start with the letters 'test' Each test uses TestCase assert* methods to check for an expected result. assertEqual() assertTrue() assertFalse() etc. setUp() and tearDown() methods are for preperation and cleanup assert* methods are used to verify actual outcome against expected result

Assert Methods Method Checks that assertEqual(a, b) a == b assertNotEqual(a, b) a != b assertTrue(x) bool(x) is True assertFalse(x) bool(x) is False assertIs(a, b) a is b assertIsNot(a, b) a is not b assertIsNone(x) x is None assertIsNotNone(x) x is not None assertIn(a, b) a in b assertNotIn(a, b) a not in b assertIsInstance(a, b) isinstance(a, b) assertNotIsInstance(a, b) not isinstance(a, b) assertRaises(exception) Method Checks that assertAlmostEqual(a, b) round(a-b, 7) == 0 assertNotAlmostEqual(a, b) round(a-b, 7) != 0 assertGreater(a, b) a > b assertGreaterEqual(a, b) a >= b assertLess(a, b) a < b assertLessEqual(a, b) a <= b assertRegexpMatches(s, r) r.search(s) assertNotRegexpMatches(s, r) not r.search(s) assertItemsEqual(a, b) sorted(a) == sorted(b) and works with unhashable objs assertDictContainsSubset(a, b) all the key/value pairs in a exist in b assertMultiLineEqual(a, b) strings assertSequenceEqual(a, b) sequences assertListEqual(a, b) lists assertTupleEqual(a, b) tuples assertSetEqual(a, b) sets or frozensets assertDictEqual(a, b) dicts

Definitions TestCase: class that extends the unittest.TestCase class. Contains one or more tests represented by testXXX methods. Used to group together tests that exercise common behaviors. TestSuite - an aggregation of individual tests cases and test suites A convenient way to group together tests that are related.

Creating TestSuite Instantiate a new TestSuite object() my_suite = unittest.TestSuite() Import your TestCase class from tests.MyTestCase import MyTestCase Add a test from the TestCase to your suite my_suite.addTest(MyTestCase("test_something")) Add all tests from the TestCase to a suite my_suite.addTest(unittest.makeSuite(MyTestCase)) Add another suite to your suite my_suite.addTest(another_suite) OR my_suite.addTest(MyTestSuite.suite())