0% found this document useful (0 votes)
72 views19 pages

Robot Automation Session October

Robot Framework is an open-source automation framework that can be used for test automation and robotic process automation. It uses a keyword-driven approach and supports testing of applications with different interfaces. The framework includes libraries that contain reusable functions, and tests are created using these libraries and keywords in a tabular format. Tests interact with the system under test via keywords and libraries, and results are output in HTML and XML formats for analysis.

Uploaded by

Karthik Mr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views19 pages

Robot Automation Session October

Robot Framework is an open-source automation framework that can be used for test automation and robotic process automation. It uses a keyword-driven approach and supports testing of applications with different interfaces. The framework includes libraries that contain reusable functions, and tests are created using these libraries and keywords in a tabular format. Tests interact with the system under test via keywords and libraries, and results are output in HTML and XML formats for analysis.

Uploaded by

Karthik Mr
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 19

Classification: KONE Internal

Let’s Automate
Classification: KONE Internal

Table of Content

Execution & Results

Test Case Structure

Libraries & Keywords

Automation Overview

RF Architecture

Framework & IDE

RF Introduction

Operation Overview
Classification: KONE Internal

Operation Overview

Changed files are given to Tester for testing Software’s are given to Manual Tester

Automation Tester Developer Manual Tester

Global Information Tracker  managing all the artifacts, binaries, packages, files,
 software for distributed version control containers, and components for use throughout your
 tracking changes in any set of files software supply chain
 coordinating work among programmers
collaboratively developing source code during
software development
Classification: KONE Internal

Robot Framework
What is Automation Testing?​
• In Simple word, Writing script for what we manually test. ​
• You can even automate things that you daily use to check routinely in your office application​

What is Robot Framework?​
• Python-based, extensible keyword-driven automation framework for testing​
• Robot Framework is a generic open-source automation framework​
• It can be used for test automation and robotic process automation (RPA).​
• Robot Framework is actively supported, with many industry-leading companies using it in their
software development.​
• It utilizes Keyword-driven testing approach​
• Suitable for both normal test automation as well as ATDD​
• The core framework is implemented using Python and also runs on Jython(JVM) and IronPython
(.NET)

Installation
• After completing PC Setup guide, install python and Robot-framework if not installed
• Version Check: Make sure the version required to install
robot –version
python3 –version
• Install Python and RobotFramework: Run the Below command in Terminal
pip install robotframework==4.1.2
sudo apt install python3
Classification: KONE Internal

Advantages
• Robot Framework is open and extensible and can be integrated with virtually any other tool to create powerful and flexible automation
solutions.​
• Robot Framework has easy syntax, utilizing human-readable keywords. ​
• Its capabilities can be extended by libraries implemented with Python or Java. ​
• The framework has a rich ecosystem around it, consisting of libraries and tools that are developed as separate projects.​
• Robot Framework project is hosted on GitHub ​
• Robot Framework is operating system and application independent​
• Robot Framework itself is open-source software released under Apache License 2.0, and most of the libraries and tools in the ecosystem
are also open source. ​
• Robot Framework has a modular architecture that supports creating tests even for applications with several diverse interfaces.

Why 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.​
• Provides easy-to-read result reports and logs in HTML format.​
• Provides a simple library API for creating customized test libraries which can be implemented natively with either Python or Java.​
• Provides a command line interface and XML based output files for integration into existing build infrastructure (continuous integration
systems).​
• Provides support for Selenium for web testing, Java GUI testing, running processes, SSH, and so on.​
• Supports creating data-driven test cases and Has built-in support for variables, practical particularly for testing in different environments.​
• Provides tagging to categorize and select test cases to be executed.​
• Enables easy integration with source control: test suites are just files and directories that can be versioned with the production code.​
Classification: KONE Internal

What is Framework and IDE we talking about?


Framework
• A framework is, in a way, software by itself
• It’s a group of rules, procedures, which allow to develop software in an easier a faster way
• The caveat is, you can build software which conforms to what the framework allows you to build
• So, building within a framework is faster and easier, but restrictive
• Developing from scratch is longer and harder , but allows infinite choices
• But, if the framework suits your needs, it’s a wise thing to use one
• We Using Robot Framework which suite’s our testing purpose

Integrated Development Environments (IDE)


• When programming, you deal with writing the code, and then running it and compiling. Usually, the tools to do all that are in
different places
• A program (or piece of program) is nothing but a text file
• And IDE is a piece of software (Application) which allows you to put all of your program pieces together under a “Project”, so
you can have everything in one place, edit and run from it, and have a debugger in it
• They might include many more features, and they make programming easier
• We Using PyCharm with Intellibot plugin, Intelliboot plugin provide set of number of features to work with Robot
framework. This plugin can find all the files from the Robot framework.

Note: You can use an IDE to program from scratch, or you can integrate a framework within an IDE, or you can use a framework
without an IDE, or program without an IDE or frameworks
Classification: KONE Internal

Robot Framework Architecture

• To proceed with Robot Framework, first we need


an IDE where we will write the Robot framework
script using some keywords.

• When we run the script/Testcase’s, it will ping to


the keywords and libraries . From here It then Robot framework IDE –
communicates with the system under test using Ride, Pycharm with
Keywords and libraries Intellliboot Plugin

• As a result, you'll receive an HTML report and


log as well as an XML output. These give you a
detailed look at what your system accomplishes.
Classification: KONE Internal

Automation Overview

• Before we are getting into Automation Coding, Lets understand What is libraries,
Keywords and Test Case
• These are nothing but tier’s structure – Usually most of the automation testing has
three tier structure  Library is the core; Next will be Keywords and using both
these library and keywords, Testcase’s are implemented.
• Why we having such 3 or 4 Tier structure
• For convenient Purpose
• Proper Alignment
• Reuse the same function
• Still Confused?  Let’s see the overall picture of it before getting deep in each
concept separately.
• We having 4 tier structure/Abstraction level  Protocol; Library; Keyword; Testcases
• Within Csi_test_tools – We have library and within that we have protocol too.
Classification: KONE Internal

Protocol
• Visit: kcegc/tests/libraries/csi_test_tools/protocol
• This is the core of the testcase’s. Protocols are created to serve the needs
of different types of data communication between devices
Classification: KONE Internal

• This londcslayer act as interface between system


and script
• i.e whatever we transmit and receive from lon
(the feature and structure of feature might vary
like tca_roof, pit, OSS, CAM, Destination call etc).
All these message are converted into packet’s
and transmitted or received from lon through
this layer
• Refer Csi_test_tools, We have lot of such
handle_transmit and receive in all the protocol
• Example emc.py  to interact with lcelift this
protocol used
Classification: KONE Internal

Library
 This is nothing but Python function’s
 Robot Framework itself is not built to interact with a specific system and does not have a strictly defined list of functionalities.
 Instead, it is built to be easily extended to work with any possible target system
 These extensions to the framework are called libraries
 Libraries provide the actual automation and testing capabilities to Robot Framework by providing keywords.
 All robot framework keywords are imported from library​
 The framework itself ships with standard libraries, used to handle common cases
Example:

- Builtin
- OperatingSystem
- String
- Collections
- DateTime
- Process
Classification: KONE Internal

 They also maintains a set of libraries that are built specifically to support few automation cases. Which we usually call as external
library

- SeleniumLibrary
- SSHLibrary
- Httplibrary
 Except for the standard set, libraries come in packages that you have to add before you can use them in your robot

What if I don't find a library that does what I need?


 If you don't find a library that matches your use case, you can create your own test library Example: csi_test_tools
Refer: kcegc/tests/libraries
Classification: KONE Internal

Csi_test_tools
• These are some examples of how we writing our own function to communicate with the system
Classification: KONE Internal

Keywords
• Keywords are operations that your robot can execute to accomplish various tasks, and are the foundation of any robot script
• Keywords can be reused, and they can be composed, which means that you can create keywords by calling other keywords
• Keywords can be defined outside of the test suite and be imported as an external resources.​
• User defined keywords can be used to wrap built-in keywords in order to maintain level of abstraction
Classification: KONE Internal

Testcase’s
Classification: KONE Internal

Test Structure:

Execution: In this alignment this test will run


DCS2 Suite Setup json=robot_4_dd_lifts_dla
DIN L Test Setup
LON DCS Call When CTL Activated
DIN Test Teardown

​ DIN L Test Setup


LON DCS Call When TCARoof Activated
DIN Test Teardown
DCS2 Suite Teardown
Classification: KONE Internal

Execution and Result:


To Run entire test suite:
./testrunner -w -- -L TRACE robot/lce/acs_dd_extended_release.robot
To Run Single test within Test Suite:
./testrunner -w -- -L TRACE -t “Reserve from ELink release from DOP” robot/lce/acs_dd_extended_release.robot

Files Which are created locally on execution of test case


 report.html
- Higher level test report.
- Report gives overview of the test execution which details clearly viewable statistics including Pass/Fail ratios and elapsed times.
 log.html
- Detailed test execution log.
- Log gives details from each step of the test execution, from keyword to keyword.
- It enables you to view the specifics of the test in case of failure or otherwise.
 output.xml
- Results in machine readable XML format.
 Stdout.log
- Similar to syslog
Classification: KONE Internal
Classification: KONE Internal

You might also like