Вы находитесь на странице: 1из 29

Robot Framework Introduction

Test Automation

1 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled Zayed
Content

• What is Robot Framework

• Tabular test data syntax

• Robot Framework Installation

• Test Environment setup

• Example Test case

2 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Content

• What is Robot Framework

• Tabular test data syntax

• Robot Framework Installation

• Test Environment setup

• Example Test case



3 © Nokia Solutions and Networks 2016
MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
What is Robot Framework
Introduction (1/4) – Robot Framework Overview

• Robot Framework is a generic test automation framework


- Easy-to-use Tabular test data syntax
- Uses keyword-driven testing
- Implemented with Python
• Testing capabilities can be extended by using Python or Java
• In GVe we use Python
- Open Source

4 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
What is Robot Framework
Introduction (2/4) – Robot Framework Overview

Robot Framework Core


(Standard Libraries, Reporting)

Robot Framework IDE


(RIDE, Eclipse)
External
Library

External
Library
External
Library
.
------------------------
Resourc
e File
Resourc
e File
… Resourc
e File
.
Testsuite Testsuite
… Testsuite

5 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
What is Robot Framework
Introduction (3/4) – Robot Framework Overview

• Robot Framework Core: Contains Standard Test Libraries

• Robot Framework IDE: Graphical User interface that can help a lot in writing
and managing testcases and keywords written in Resource Files. IDE
contains a code editor, a complier and a debugger
- RIDE: Robot Integrated Development Environment used to design and run testcases
(Not compatible with the new Robot Versions ,Temporary Problem)
- Eclipse: Define testing environment

6 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
What is Robot Framework
Introduction (4/4) – Robot Framework Overview

• Testsuits: this is where tests are defined and implemented

• Resource Files: Higher-level keywords (Functions) that are defined by


developer that can be used in testcase execution

• Test Library: Test libraries provide the actual testing capabilities to Robot
Framework by providing keywords. There are several standard libraries that
are bundled in with the framework, and a bunch of separately developed
external libraries that can be installed based on your needs.

7 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Content

• What is Robot Framework

• Tabular test data syntax

• Robot Framework Installation

• Test Environment setup

• Example Test case

8 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Tabular test data syntax
What is Tabular data syntax

• Robot Framework test cases are created using a simple tabular syntax
• Test data is structured in four types of tables listed below:
Table name Used for Aliases

Setting table - Importing test libraries, resource files and variable files Setting, Settings,
- Defining metadata for test suites and test cases Metadata
Variable table - Defining variables that can be used elsewhere in the test data Variable, Variables

Test case table Creating test cases from available keywords Test Case, Test
Cases
Keyword table Creating user keywords from existing lower-level keywords Keyword, Keywords,
User Keyword, User
Keywords

9 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Tabular test data syntax
Test case example
*** Settings ***
Suite Setup
Suite Teardown
Metadata \ ${EMPTY}
Library monster
Library sshconnection
*** Variables***
${TC_name} DemoTestCase
*** Test Cases ***
Demo Testcase
[Setup] Setup Testline

*** Keywords ***


Setup Testline
Enable monster console events
Require enb enb1
Require enb enb2

10 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Tabular test data syntax
RIDE (1/2)

11 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Tabular test data syntax
RIDE (2/2)

12 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Tabular test data syntax
Keywords (1/2)

• Method or Function that can be used to test or help test one aspect of System
under Test

• Keywords can be
- Built-in with Robot Framework
- Self developed to execute a certain function

• Keywords are written as a combination of already existing Keywords or


developed from scratch by the developer

13 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Tabular test data syntax
Keywords (2/2)
Keyword “Test Function 1”
Input: A,B,C
Expected Result: X

Keyword “Update Input Table ”


Input: A,B,C
Expected Result: ok/nok

Keyword “Connect to DB”


Input: Connection-String
Expected Result: ok/nok

Keyword “Insert to table ”


Input: Table-Name, Value
Expected Result: ok/nok

Keyword “Execute Process”


Input: Process name
Expected Result: ok/nok

14 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Content

• What is Robot Framework

• Tabular test data syntax

• Robot Framework Installation

• Test Environment setup

• Example Test case

15 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Robot Installation
Robot Environment

• No extra HW installation is needed


• Virtual machine Linux based
UTE Libraries

Robot IDE (RIDE)

Eclipse
Should be installed with Virtual machine
Robot Framework installation

Python

16 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Robot Installation
UTE Libraries

• To get the UTE Libraries the following command shall be written in the
Terminal:
- svn checkout --username {nsn_login} https://ulisop10.emea.nsn-
net.net/isource/svnroot/robotlte/trunk (access is needed)

17 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Content

• What is Robot Framework

• Tabular test data syntax

• Robot Framework Installation

• Test Environment setup

• Example Test case

18 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Test Environment setup
Must have

• Attenuator with Blocks

• Linux Wireshark

• Commercial UEs (Air Card, LG G5, Android Smart phones, Dongles)

19 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Test Environment setup
Define IP address of all equipment

• Add all of the IP address of all equipment's in hosts file on Robot PC


• Hosts file can be found under this directory
- /etc/hosts

20 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Test Environment setup
Enable SSH Connection on all devices (1/2)
• To be able to run test cases on Robot SSH connection from Robot machine to
all Windows PCs (LMT PC, App-Server, UE PCs) should be possible
- If Cygwin was already installed please follow these steps under this link:
• \\utranserver.ulm.nsn-rdnet.net\utran\TOOLS\cygwin_2016_07_19\cygwin-install\readme.txt
- Install Cygwin all PCs (LMT PC, App-Server, UE PCs)
• Right click on My Computer  Mange  Local Users and Groups  Users
• Delete all users expect Administrator and root

• Install Cygwin: \\utranserver.ulm.nsn-rdnet.net\utran\TOOLS\cygwin_2016_07_19\


21 © Nokia Solutions and Networks 2016
MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Test Environment setup
Enable SSH Connection on all devices (2/2)
- From Robot PC try SSH connection to eNB PC

SSH Connection is working

22 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Test Environment setup
Robot tools on all test line PCs

• Robot tools shall be copied to E directory:


- From Robot PC using SCP command:
• Open a terminal, go to:
- cd /opt/virtualenv/ute/lib/python2.7/site-packages/robotws/tools/
- rm robot_tools.tgz
- tar - cvzf robot_tools.tgz
- On target pc create on drive E the folder robot_tools
- scp robot_tools.tgz Administrator@lmt-pc-1: /cygdrive/e/robot_tools/ Drive E is not a must

23 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Test Environment setup
Install jre1.8.0_45 on lmt PCs

• Install Java on lmt PCs can be found under Utran:


- U:\TOOLS\Java\JavaRuntimeEnvironment\jre-8u45-windows-x64

• Add path C:\Program Files (x86)\Java\jre8\bin in the Environmental variables

24 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Test Environment setup
Load workspace on Eclipse

25 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Test Environment setup
Define Testline in Eclipse
• Testline should be defined under trunk/config/Ulm/Gve/CP/TL10xx

configure your line


Copy TL_template and
26 © Nokia Solutions and Networks 2016
MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Test Environment setup
Linking RIDE with Configured Testline
• After Line configurations are done in the Eclipse, RIDE should be linked with
configured Testline
- In the RIDE under run tab this arguments should be given

27 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Content

• What is Robot Framework

• Tabular test data syntax

• Robot Framework Installation

• Test Environment setup

• Example Test case

28 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed 10.11.2016
Any Questions

29 © Nokia Solutions and Networks 2016


MBB LTE GVe CP1 / Khaled
Zayed

Вам также может понравиться