Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2012 LogiGear Corporation. All Rights Reserved Robot framework.

Similar presentations


Presentation on theme: "© 2012 LogiGear Corporation. All Rights Reserved Robot framework."— Presentation transcript:

1 © 2012 LogiGear Corporation. All Rights Reserved Robot framework

2 © 2012 LogiGear Corporation. All Rights Reserved OUTLINE  Introduce Robot Framework  Introduce RIDE - Robot Framework test data editor  Automate with RIDE  Reference Documents

3 © 2012 LogiGear Corporation. All Rights Reserved Introduce Robot Framework Robot Framework is a Python-based, extensible keyword- driven test automation framework. It can be used for testing distributed, heterogeneous applications, where verification requires touching several technologies and interfaces Provides support for Selenium for web testing, Java GUI testing, running processes, Telnet, SSH, and so on.SeleniumJava GUI testingrunning processesTelnetSSH

4 © 2012 LogiGear Corporation. All Rights Reserved Introduce Robot Framework  Enables easy-to-use tabular syntax for creating test cases in a uniform way.  Provides ability to create reusable higher-level keywords from the existing keywords.higher-level keywords  Has built-in support for variables, practical particularly for testing in different environments.variables  Provides easy-to-read result reports and logs in HTML format.reportslogs  Provides tagging to categorize and select test cases to be executed.taggingselect test cases

5 © 2012 LogiGear Corporation. All Rights Reserved Introduce Robot Framework  Provides a simple library API for creating customized test libraries which can be implemented natively with either Python or Java.library API  Provides a command line interface and XML based output files for integration into existing build infrastructure (continuous integration systems).command line interfaceoutput files  Supports creating data-driven test cases.data-driven test cases  Enables easy integration with source control  Provides test-case and test-suite -level setup and teardown.test-casetest-suite

6 © 2012 LogiGear Corporation. All Rights Reserved Introduce RIDE The Robot Framework is a mature tool to implement automated tests. With the help of the GUI application RIDE (= Robot IDE) and supported by its keyword-driven approach even less technical oriented people can start implementing testcases quite quickly.Robot Framework RIDE (= Robot IDE) RIDE is a test data editor for Robot Framework test data. It is possible to copy data between RIDE's grid based editors and spreadsheet programs such as Excel and OpenOffice.

7 © 2012 LogiGear Corporation. All Rights Reserved Installation Pre-conditions:  Install Java Development Kit (JDK) - “jdk_1.6_Kit-6_Update-10  Install Python 2.7.1 - python – 2.7.1.msi  Install wxPython - wxPython2.8-win32-unicode-2.8.12.0-py27 Main installation:  Install RobotFramework 2.5.7 - robotframework-2.5.7.win32  Install RobotFramework – Seleniumlibrary - robotframework – seleniumlibrary – 2.9.win32.exe  Install RobotFramework – RIDE - robotframework-ride- 0.35.1.win32.exe Edit environment variable “Path”: Insert into “Variable value” textbox: C:\Python27;C:\Python27\Lib;C:\Python27\Scripts.

8 © 2012 LogiGear Corporation. All Rights Reserved Starting RIDE  How to Automate a Test Case Configuration Create New Project Capture Interface Create New Action Create Test Suite Execute Test Suite  Some Advanced Techniques Setting table For loop – Exit for loop Repeat keyword Test library

9 © 2012 LogiGear Corporation. All Rights Reserved Hierarchical structure  Test cases are created in test case files.  A test case file automatically creates a test suite containing the test cases in that file.  A directory containing test case files forms a higher- level test suite. Such a test suite directory has suites created from test case files as its sub test suites.  A test suite directory can also contain other test suite directories, and this hierarchical structure can be as deeply nested as needed.  Test suite directories can have a special initialization file.  Test libraries containing the lowest-level keywords.  Resource files with variables and higher-level user keywords.  Variable files to provide more flexible ways to create variables than resource files.

10 © 2012 LogiGear Corporation. All Rights Reserved Simple Test case Step: 1. Navigate to Yahoo Mail page 2. Login in to Yahoo Mail Expected result: Verify that user can login Yahoo Mail successfully

11 © 2012 LogiGear Corporation. All Rights Reserved Configuration Run the RIDE: Select to run “ride.py” file in the “Scripts” folder in your local machine

12 © 2012 LogiGear Corporation. All Rights Reserved Create New Project Select “New Project” from “File” menu to create a new one.

13 © 2012 LogiGear Corporation. All Rights Reserved Capture Interface Right click on “Resources” folder to add a new resource file for storing the interface

14 © 2012 LogiGear Corporation. All Rights Reserved Capture Interface Useful Tools to locate elements:  Selenium IDE: Selenium IDE is a Firefox plugin that does record-and-playback of interactions with the browser  Firebug: Firebug integrates with Firefox to put a wealth of web development tools at your fingertips while you browse  Firepath: a Firebug extension that adds a development tool

15 © 2012 LogiGear Corporation. All Rights Reserved Capture Interface Add new scalar to the existed interface file with value from capture tool.

16 © 2012 LogiGear Corporation. All Rights Reserved Capture Interface Completed adding the interface on RIDE

17 © 2012 LogiGear Corporation. All Rights Reserved Capture Interface Adding one more interface for main page, contain the SignOut link (//a[contains(text(),'Sign Out')]).

18 © 2012 LogiGear Corporation. All Rights Reserved Create New Action Right click on “Resources” folder to add a new resource file for storing the action

19 © 2012 LogiGear Corporation. All Rights Reserved Create New Action Add new User Keyword in the existed action file

20 © 2012 LogiGear Corporation. All Rights Reserved Create New Action For using Selenium function, you have to add the SeleniumLibrary into the resource file ( or Suite file)

21 © 2012 LogiGear Corporation. All Rights Reserved Create New Action For using the element, you have to add the interface (Interface_LoginPage.html) into your file

22 © 2012 LogiGear Corporation. All Rights Reserved Create New Action Edit the Login action with steps: 1.Input username 2.Input password 3.Click sign in button.

23 © 2012 LogiGear Corporation. All Rights Reserved Create Test Suite Right click on project folder, choose “Add Suite” as “LoginPageFunction”

24 © 2012 LogiGear Corporation. All Rights Reserved Create Test Suite Setting the test suite:  Add “Stop Selenium Server” into “Suite Teardown”.  Add “Close All Browsers” into “Test Teardown”.

25 © 2012 LogiGear Corporation. All Rights Reserved Create Test Suite Then add library and resource that needed into the test suite:  SeleniumLibrary  Interface_LoginPage.html  Interface_MainPage.html  Action_LoginPage.html

26 © 2012 LogiGear Corporation. All Rights Reserved Create New Test Case Right click on the new test suite, choose “New Test Case”. Name as “User can login Yahoo Mail with valid username and password”

27 © 2012 LogiGear Corporation. All Rights Reserved Create New Test Case Edit the content of test case:

28 © 2012 LogiGear Corporation. All Rights Reserved Execute Test Suite Run the test case by clicking on “Run” tab (1), choosing the test case (2) and click on “Start” button (3).

29 © 2012 LogiGear Corporation. All Rights Reserved Result There are two ways to view the result: Report and Log. Click on them to launch the result html file.

30 © 2012 LogiGear Corporation. All Rights Reserved Result Report file

31 © 2012 LogiGear Corporation. All Rights Reserved Result Log file, you can see the log of steps there.

32 © 2012 LogiGear Corporation. All Rights Reserved Advanced Settings table [Documentation] Used for specifying a test case documentation.  The [Documentation] setting allows you to set a free documentation for a test case  That text is shown in the command line output, as well as the resulting test logs and test reports.

33 © 2012 LogiGear Corporation. All Rights Reserved Advanced Settings table [Suite Setup], [Suite Teardown], [Test Setup], [Test Teardown], [Setup] and [Teardown] Specify Precondition and Postcondition at Suite/Test case level.  [Setup] or [Teardown] settings in the test case table override possible Test Setup and Test Teardown settings  Use value NONE to indicate that a test has no setup/teardown

34 © 2012 LogiGear Corporation. All Rights Reserved Advanced Settings table [Force Tags] All test cases in a test case file with this setting always get specified tag [Default Tags] Test cases that do not have a [Tags] setting of their own get these tags. [Tags] A test case always gets these tags. Use value NONE to override default tags

35 © 2012 LogiGear Corporation. All Rights Reserved Advanced Settings table [Test Template] Reducing duplication with data-driven tests. Instead of repeating the same keyword with all the tests in a file, it is possible to use it only once in the Setting table.

36 © 2012 LogiGear Corporation. All Rights Reserved Advanced Settings table [Timeout] if a test or keyword is not finished within the specified time, the keyword that is currently being executed is forcefully stopped.

37 © 2012 LogiGear Corporation. All Rights Reserved Advanced FOR Loop For loops can be used with both test cases and user keywords. Except for really simple cases, user keywords are better, because they hide the complexity introduced by for loops. The basic for loop syntax, FOR item IN sequence

38 © 2012 LogiGear Corporation. All Rights Reserved Advanced FOR Loop For item in range

39 © 2012 LogiGear Corporation. All Rights Reserved Advanced FOR Loop Exit For Loop keyword can be used directly in a for loop or in a keyword that the for loop uses. In both cases the test execution continues after the for loop. If executed outside of a for loop, the test fails.

40 © 2012 LogiGear Corporation. All Rights Reserved Advanced Repeat BuiltIn keywordBuiltIn keyword Repeat Keyword takes a keyword and how many times to repeat it as arguments.

41 © 2012 LogiGear Corporation. All Rights Reserved Advanced Test libraries Robot Framework's actual testing capabilities are provided by test libraries. There are many existing libraries, some of which are even bundled with the core framework, but there is still often a need to create new ones. Robot Framework itself is written with Python and naturally test libraries extending it can be implemented using the same language.Python When running the framework on Jython, libraries can also be implemented using Java. Pure Python code works both on Python and Jython, assuming that it does not use syntax or modules that are not available on Jython.JythonJava When using Python, it is also possible to implement libraries with C using Python C API, although it is often easier to interact with C code from Python libraries using ctypes module.Python C APIctypes

42 © 2012 LogiGear Corporation. All Rights Reserved Refer document Robotframework http://code.google.com/p/robotframework/ Selenium action: http://robotframework- seleniumlibrary.googlecode.com/hg/doc/SeleniumLibrary.html?r=2.7 Build-in action: http://robotframework.googlecode.com/hg/doc/libraries/BuiltIn.html?r=2.7.1 http://blog.codecentric.de/en/2012/01/robot-framework-ide-ride-overview/ User guide: http://robotframework.googlecode.com/hg/doc/userguide/RobotFrameworkUse rGuide.html


Download ppt "© 2012 LogiGear Corporation. All Rights Reserved Robot framework."

Similar presentations


Ads by Google