1 of 20

A gentle introduction to Robot Framework

Efremova Elizaveta

Software Quality Engineer

© Copyright 2018 Dell Inc.

1

2 of 20

[Blank]

© Copyright 2018 Dell Inc.

2

3 of 20

What is Robot Framework?

© Copyright 2018 Dell Inc.

3

4 of 20

History

  • 2005
    • Developing in Finland by Pekka Klarck
    • Version 1.0 released at Nokia Networks
  • 2008
    • Version 2.0 released as an open source

software

  • 2018
    • Version 3.0.1 released

© Copyright 2018 Dell Inc.

4

5 of 20

Useful links

Official site

https://robotframework.org/

GitHub project

https://github.com/robotframework/robotframework

https://github.com/robotframework/QuickStartGuide/blob/master/QuickStart.rst

Quick Start

© Copyright 2018 Dell Inc.

5

6 of 20

How to use Robot Framework?

© Copyright 2018 Dell Inc.

6

7 of 20

KEYWORD

© Copyright 2018 Dell Inc.

7

8 of 20

Keyword structure

*** Keywords ***�User enter text to a search field� [Arguments] ${text} ${field_xpath}� Search page should be open� Wait until page contains ${field_xpath}� Search field exists on page� Input text to a search field� Press enter� [Return] True

© Copyright 2018 Dell Inc.

8

9 of 20

Keyword structure

@keyword�def wait_until_page_contains(self, text, timeout=None, error=None):� """Waits until ``text`` appears on current page.� Fails if ``timeout`` expires before the text appears. See� the `Timeouts` section for more information about using timeouts� and their default value.� ``error`` can be used to override the default error message.� """� self._wait_until(lambda: self.is_text_present(text),� "Text '%s' did not appear in <TIMEOUT>." % text,� timeout, error)

© Copyright 2018 Dell Inc.

9

10 of 20

Import keywords

*** Settings ***Library String�Library DateTime�Library lib.DLm�Library lib.Mainframe�Resource resources/Mainframe_Keywords.robot�Resource resources/Storage_keywords.robot�Resource resources/dlm_common_keywords.robot

© Copyright 2018 Dell Inc.

10

11 of 20

TEST CASE

© Copyright 2018 Dell Inc.

11

12 of 20

Test structure

Name

Body

[Documentation]

[Tags]

[Timeout]

[Teardown]

[Setup]

© Copyright 2018 Dell Inc.

12

13 of 20

How to run

>robot --include TEST-24 file_with_test_cases.robot

>robot file_with_test_cases.robot

>robot --test “User can find information with start page“

file_with_test_cases.robot

© Copyright 2018 Dell Inc.

13

14 of 20

REPORTS

© Copyright 2018 Dell Inc.

14

15 of 20

Reporting

log.html

report.html

© Copyright 2018 Dell Inc.

15

16 of 20

Reporting

ALLURE REPORTER

log.html

report.html

© Copyright 2018 Dell Inc.

16

17 of 20

Integration with Jenkins

Robot Framework Plugin

https://wiki.jenkins.io/display/JENKINS/Robot+Framework+Plugin

© Copyright 2018 Dell Inc.

17

18 of 20

Why Robot Framework?

© Copyright 2018 Dell Inc.

18

19 of 20

ATDD

keyword-driving testing

platform independent

integration testing

system testing

good reporting

open source

integration with Jenkins/…

© Copyright 2018 Dell Inc.

19

20 of 20

© Copyright 2018 Dell Inc.

20