Pythonで書ける検証自動化:RobotFrameworkとは | 瀬戸内の雲のように

Pythonで書ける検証自動化:RobotFrameworkとは

Posted: 2018-02-26


スポンサーリンク

目次

背景

最近は働き方改革がトレンドになってますが、エンジニアにとっての働き方改革、つまり稼働削減といえば自動化です。なかでも検証自動化は品質向上の観点からも推奨されており、ある意味流行りと言えますし、永遠のテーマとも言えるかと思います。

RobotFrameworkとは

本題のRobotFrameworkですが、これはPythonをベースに作られており、Pythonでライブラリを自作したりできます。

個人的な間隔ですが、検証自動化のツールはRubyベースのものが多い気がしており(ソフトウェア開発系の自動化ならRspecやCucumberが有名ですし、サーバなどインフラ環境の自動化ではserverspecがよく使われています)、Pythonで書けるというのは貴重だと思います。
(Pythonが好きというわけではないですが)

RobotFrameworkの特徴

さて、そんなRobotFramework(以下RF)を使った感想を簡単にまとめると

  • 記述の柔軟性が高い
  • Pythonを知らなくても書ける(Pythonあまり関係ない)
  • 結果が見やすい

といったものが挙げられるかと思います。

それぞれ、もう少し詳細に説明してみます。

  

記述の柔軟性が高い

RobotFrameworkにはビルトインのキーワード(RF上で使えるコマンド的なもの)が用意されていますが、キーワードを組み合わせたものを独自キーワードとして定義し簡単に再利用することができます。これにより記述の抽象度が変えやすく、使う人や見せる人に合わせた記述がやりやすいです。

  

Pythonを知らなくても書ける(Pythonあまり関係ない)

これは良し悪しかもしれませんが、RFでは前述の通りキーワードを使ってテストシナリオを作成します。これはRobotFramework語とでも言える、一つの言語のようなものであり、Pythonとはほぼ無関係です。

故に、Pythonを知らなくても書けるし、逆に言うとPythonを知っているだけでは書けないということです。またそのキーワードを使った記法も少し独特で、学習コストは高めかもしれません。

一方、Pythonを使った記述も可能ではあり、Pythonで作った関数をRFのキーワードとして利用することができます。ただこれはPythonに限らずRubyやシェルスクリプトでもOKで、RFでやりにくい処理(jsonのパース等)は別スクリプトで書いたほうが良い場合もあるかと思います。
 
 

結果が見やすい

RobotFrameworkでは実行結果を自動的にHTMLとして出力してくれます。ただのテキストよりも見やすいので便利です。
ちなみにHTMLは後ほど実物をお見せします。

 

RobotFrameworkでHelloworld

ここからは実際にRFを使ってみます。

 

RobotFrameworkのインストール

まずはインストールです。これはpipで一発です。ちなみに環境はAmazon Linuxを想定しています。

# pip install robotframework
Collecting robotframework
  Downloading robotframework-3.0.2.tar.gz (440kB)
    100% |????????????????????????????????| 450kB 2.4MB/s
Installing collected packages: robotframework
  Running setup.py install for robotframework ... done
Successfully installed robotframework-3.0.2

簡単です。

Helloworldを書いてみる

では、最も初歩的なテストシナリオとしてHello world!!!と画面に表示するだけのシナリオを書いてみます。

# vim hello.robot
# -*- coding: utf-8 -*-
*** Test Cases ***
Say Hello World
        Log To Console   Hello world!!!

たったの4行です。

 

実行してみる

次に実行してみます。

# robot hello.robot
==============================================================================
Hello
==============================================================================
Say Hello World                                                       Hello world!!!
Say Hello World                                                       | PASS |
------------------------------------------------------------------------------
Hello                                                                 | PASS |
1 critical test, 1 passed, 0 failed
1 test total, 1 passed, 0 failed
==============================================================================
Output:  /root/output.xml
Log:     /root/log.html
Report:  /root/report.html

こんな感じです。
"Say Hello World" というところの右側に "Hello World!!!"と表示していることがわかります。

 

結果を見る

さて先程説明した通りRobotFrameworkでは結果が自動生成されますので、そのHTMLを見てみます。

 
結果サマリ

 
結果詳細

まとめ

以上、RobotFrameworkの概要でした。また細かい使い方等は別記事にしていきたいと思います。


スポンサーリンク




コメント一覧

2022/09/18 07:30:49

Michaelpedさん

You actually reported it fantastically!
canadian pharmacy uk delivery canadian family pharmacy pharmacy price comparison https://canadianonlinepharmacybase.com


2022/09/18 09:22:10

EachelleOaOaさん

dateing site
good free dating wesbites
popular dating sites


2022/09/18 11:53:23

Wendellunapsさん

Cheers! I enjoy this.
pharmacy canada walgreens online pharmacy pharmacies


2022/09/18 19:36:31

Elileafさん

doxycycline and dairy And then there s other things, such as postsurgical cases that affect the trigeminal nerve, that can also be a cause of NK.


2022/09/19 02:40:38

BruceCandyさん

You actually stated this adequately!
prescription drugs from canada canadian pharmacy uk delivery pharmacy


2022/09/19 09:17:54

JoeteOaOaさん

free meeting online
dating sites in usa
flirt singles


2022/09/19 10:40:10

AlvinJowさん

You actually revealed it superbly.
cliche college essays essay rewriter law essay writing service


2022/09/19 16:28:47

BruceCandyさん

You expressed this superbly!
prescription discount pharmacy near me online pharmacy viagra


2022/09/19 20:23:33

MarrisOaOaさん

essay writers review
buy college essay
essay writer


2022/09/19 22:51:27

AlvinJowさん

Thanks, Helpful information!
best essay website how to write good college application essays help me write my thesis statement


2022/09/20 01:20:33

AlvinJowさん

Cheers. Ample info!

how to write an persuasive essay writing my essay business writing services


2022/09/20 15:23:14

DorolisaOaOaさん

help on essay writing
essayhelp
professional essay writer


2022/09/21 00:51:35

AlvinJowさん

Amazing loads of superb material!
easy steps to write an essay how to write a scientific essay best essay websites


2022/09/21 01:37:56

AlvinJowさん

Seriously quite a lot of excellent knowledge!
writing a reflective essay essay writer writing helps


2022/09/21 14:44:05

AlvinJowさん

Nicely put, Thank you.
custom essay company how to write a hook for an essay custom writing service reviews


2022/09/21 17:43:53

Michaelpedさん

You suggested that very well!
canada pharmacy online no script cheap canadian drugs canadian pharcharmy https://canadapharmacies-24h.com


2022/09/21 22:34:38

Wendellunapsさん

Many thanks, An abundance of knowledge.

online pharmacy without scripts canadian pharmacy uk delivery meds online without doctor prescription


2022/09/22 02:55:10

AlvinJowさん

Very good data. Thanks.
help writing a comparison and contrast essay https://homeworkcourseworkhelps.com/ seo copywriting services


2022/09/22 07:38:52

Michaelpedさん

Helpful stuff. Many thanks.
mexican online pharmacies canadian pharmacy uk delivery canadian pharmacy meds https://canadianpharmacylist.com


2022/09/22 09:11:17

MerolaOaOaさん

cheap essay service
academic essay writing help
need help writing an essay


2022/09/22 13:28:05

BruceCandyさん

Wonderful content. Thanks!
generic viagra online buy cialis canada discount drug


2022/09/22 15:54:57

AlvinJowさん

You have made your position pretty well!.
essay writing website reviews argumentative essay topics essay ghostwriter


2022/09/22 16:52:34

AlvinJowさん

Thank you, Great information.
writing a college admissions essay rubrics for essay writing cv writing services london


2022/09/23 05:07:16

AshlenOaOaさん

essay 123 help
mba admission essay writing service
custom essay service


2022/09/24 00:55:41

CharitaOaOaさん

write my essay for me cheap
custom written essay
definition essay help


2022/09/24 08:42:57

AlvinJowさん

You said that wonderfully!
how to write essays faster steps on writing an essay cheap essay writing service us


2022/09/24 18:48:49

CharitaOaOaさん

easy essay writer
mba essay writing services
write my essay help


2022/09/25 14:18:51

NaniceOaOaさん

essay writers service
essay writing service law school
help with argumentative essay


2022/09/26 09:20:13

ChelsaeOaOaさん

essay help college
help with writing an essay
critical essay help


2022/09/27 04:43:57

PennyOaOaさん

law school essay writing service
lord of the flies essay help
cheap law essay writing service


2022/09/28 00:49:43

TammieOaOaさん

essay writing service canada
write my admissions essay
write my essay 4 me


2022/09/28 20:20:13

AntonieOaOaさん

academic essay writers
cheap essay writing service online
mba essay help


2022/09/29 15:47:36

RhiamonOaOaさん

best college essay service
essays writing services
essay services


2022/09/30 11:14:40

CharoOaOaさん

write my essay for cheap
essay homework help
essay help toronto


2022/10/01 05:56:17

DronaOaOaさん

help writing an essay for college
essay helper
help me write a compare and contrast essay


2022/10/02 01:32:34

TwylaOaOaさん

write my essay reviews
can i hire someone to write my essay
automatic essay writer


2022/07/07 15:47:26

AurlieOaOaさん

wind creek online casino real money
vegas slots free casino
777 slots free


2022/07/18 11:04:25

JoeteOaOaさん

writing a dissertation introduction
rutgers dissertation proposal help
buy dissertations


2022/07/20 06:43:42

ChandaOaOaさん

language editing phd thesis
writing your dissertation
nursing dissertation help


2022/07/21 04:08:09

AvivaOaOaさん

dissertation writing process
dissertation writing assistance
edd dissertation topics


2022/07/21 23:29:01

DortheaOaOaさん

help tutor
cheap dissertation writing
law dissertation writing service


2022/07/22 18:50:19

VerieeOaOaさん

dissertation help scam
phd dissertation example
thesis dissertation


2022/07/24 03:54:13

SuzannOaOaさん

writing a doctoral dissertation
dissertation proofreading services
writing tutor


2022/07/24 22:25:12

SalliOaOaさん

dissertation express
statistics help for dissertation
dissertation definition


2022/07/25 18:39:19

DarsieOaOaさん

what is a dissertation paper
help with my dissertation
dissertation research and writing


2022/07/26 09:48:26

TandiOaOaさん

no deposit welcome bonus casino
online casinos no deposit
casino bonus no deposit


2022/07/27 11:12:34

TandiOaOaさん

gambling casino online bonus
online casino no deposit
online casino games real money


2022/07/27 14:10:12

JenneeOaOaさん

phd dissertation peer reviewing help
dissertation help leicester
dissertation writing advice


2022/07/28 11:13:42

AbagaelOaOaさん

no deposit sign up bonus
no deposit bonus online casino
online casino bonus


2022/07/28 10:41:38

HerminaOaOaさん

writing dissertation abstract
dissertation format
dissertation proposal sample


2022/07/29 06:25:11

AudreOaOaさん

medical dissertation writing services
help writing
dissertation acknowledgements


2022/07/29 10:18:23

ShaylaOaOaさん

mobile casino sites
free money casino
real money online slots


2022/07/30 02:21:20

HestiaOaOaさん

dissertation writing fellowships
proquest dissertation
writing a phd dissertation


2022/07/30 09:00:38

VerenaOaOaさん

casino no deposit welcome bonus
online blackjack for real money
wild casino online


2022/07/31 06:54:36

DixieOaOaさん

win real money casino
casino play for real money
more casino games


2022/08/02 05:56:12

FranniOaOaさん

casino deposit bonus
[url="https://cybertimeonlinecasino.com"]real cash online casino[/url]
free welcome bonus no deposit casino


2022/08/03 04:17:32

PearlOaOaさん

bonus casino no deposit
casino online usa
best real money online casino


2022/08/04 02:53:43

BobbieOaOaさん

blackjack real money
online casinos free bonuses
usa online casino


2022/08/05 00:55:32

LeslieOaOaさん

online casino review
free sign up bonus
best online casino to win money


2022/08/07 19:56:38

HonorOaOaさん

best vpn avast
ipvanish vpn
best cheap vpn reddit


2022/08/08 01:26:21

TrudieOaOaさん

wild casino online
casino no deposit bonus
real casino games online


2022/08/08 16:10:05

TeddieOaOaさん

reddit free vpn
windscribe free vpn
best secure vpn for mac


2022/08/09 01:36:22

JaynellOaOaさん

casinos online real money
free online casino no deposit
casino welcome bonus no deposit


2022/08/10 00:37:00

JenneeOaOaさん

how to get a vpn
buy vpn with perfect money
best lifetime vpn


2022/08/10 09:12:24

DulceaOaOaさん

best online casino for us players
[url="https://onlinecasinofortunes.com"]online casino bonuses[/url]
online casinos no deposits


2022/08/10 20:51:57

JenneeOaOaさん

one time buy vpn
best buy vpn
japan vpn free


2022/08/11 08:26:20

CarolanOaOaさん

free money no deposit casino
online casino usa
real money online casinos


2022/08/11 17:07:52

AshleighOaOaさん

best vpn torrenting
vpn reviews
free vpn for phone


2022/08/12 08:21:29

FanyaOaOaさん

casino bonus
online casino win real money
bonus casino no deposit


2022/08/15 14:23:58

SheelaghOaOaさん

top vpn
vpn free ip address
vpn chrome extension


2022/08/15 23:12:39

FifineOaOaさん

online casino welcome bonus
best online casino to win money
real money online casinos


2022/08/16 16:13:16

Piniwhipsさん

Amoxicillin And Heart Attack stromectol price


2022/08/16 21:32:20

GwenoreOaOaさん

no deposit sign up bonus
casino bonus online
best online us casinos


2022/08/18 21:32:06

encathyさん

cialis lawyer ohio ivermectin for sale on ebay


2022/08/23 19:09:13

GladiOaOaさん

gay dating games
most popular gay dating
gay dating sites free


2022/08/24 14:20:41

JeraleeOaOaさん

gay dating sims
best free gay dating apps
college gay dating dite


2022/08/25 10:13:44

KyrstinOaOaさん

gay men web dating sites
gay dating in chicago
gay dating web sites denver. co


2022/08/26 12:49:59

BertheOaOaさん

good dating sites free
naked dating
on line dating services


2022/08/27 10:02:05

KaitlynnOaOaさん

japan bbw
japanese singles dating sites
top dating sites in usa


2022/08/28 02:17:21

GladiOaOaさん

gay boys in tampa fl dating
gay dating 70 +
free gay dating games


2022/08/28 08:03:17

DavinaOaOaさん

skycouger gf
local single women near me
pof dating app


2022/08/28 21:34:26

JeraleeOaOaさん

gay executive dating
gay dating richland, wa
free dating apps that aren't gay


2022/08/29 06:07:09

ChelsaeOaOaさん

woman dating sites
free women
free se4x


2022/08/29 16:59:35

KyrstinOaOaさん

gay interracial dating sarasota
gay male 65 + dating
free dating for bi and gay men


2022/08/30 04:31:28

EmaliaOaOaさん

free dating site
free daing
free dating websites singles


2022/08/30 13:13:34

CasandraOaOaさん

real money casino games
casino bonus online
top casino site


2022/08/31 02:29:24

KarryOaOaさん

free local singles
plenty of fish dating
pof dating website


2022/08/31 08:45:07

AmataOaOaさん

more casino games
no deposit casino
betonline casino


2022/08/31 20:42:01

offemiaさん

cialis generic reviews Some people have seen too many things that they feel powerless, and they will feel very painful, and gradually lose hope for everything


2022/09/02 01:43:15

GennieOaOaさん

michigan gay chat
free gay chat no sign up
gay chat phone numbers


2022/09/02 07:16:03

ArindVardさん

Otherwise, the free samples are great and the prices are good cialis prescription online Cialis is widely used for headache relief during women s pregnancy or, in some instances during pregnancy for anxiety relief , and is also sometimes recommended for anxiety during postpartum depression


2022/09/02 21:51:02

DeeynOaOaさん

gay chat phone lines
free gay chat lines in fitchburg,ma
free gay boys chat


2022/09/03 00:28:04

Amuxureさん

dapoxetina generico They are in foreign territories and ship their illicit drugs worldwide


2022/09/03 17:07:46

EmaleeOaOaさん

google zoom gay pnp chat
gay porn chat random
arab friends gay webcam chat


2022/09/04 12:25:51

StephineOaOaさん

best free gay chat
chicago gay chat rooms free
gay chat cam ramdoom


2022/09/04 14:04:25

Dealoneさん

hoe can i buy priligy in usa How black hate grows in the first grade


2022/09/04 23:05:12

adazirlさん

buy cialis online without a prescription Your order will be delivered within the stipulated time, the responsibility of Indian suppliers is widely known


2022/09/06 13:23:11

Pleashyさん

how much does cialis cost To date, FDA is not aware of consumer adverse events related to the use of these counterfeit versions of Cialis


2022/09/06 20:28:47

Abrahamgonさん

Kudos, An abundance of knowledge!
uc college essays writing papers thesis paper writing


2022/09/07 03:42:48

RobenaOaOaさん

gay+chat
gay male chat
gay boy jack off cam chat


2022/09/09 19:41:06

TallouOaOaさん

boy chat strip nude webcam male gay
1st avenue chat gay
cam chat gay


2022/09/10 15:44:18

MarilinOaOaさん

free chat rooms gay chat
gay chat cahurbate
gay chat rooms


2022/09/10 21:23:09

AlvinJowさん

Good forum posts. Appreciate it.
college essay assistance https://orangepornhub.com/ quality writing services


2022/09/13 13:15:06

AlvinJowさん

Thanks. I like it.
writing comparison essays https://essaypromaster.com/ resume writing services


2022/09/13 20:51:30

Michaelpedさん

You explained it terrifically.
discount canadian drugs discount drugs online pharmacy canadian mail order pharmacies https://northwestpharmacylabs.com


2022/09/14 01:30:49

AlvinJowさん

Thanks, Helpful stuff!
learning to write an essay essays writing services citing a website in an essay


2022/09/14 03:52:45

AlvinJowさん

Valuable info. Kudos.
analysis essay writing college essay top writing services


2022/09/14 14:32:32

Wendellunapsさん

You stated this wonderfully.
best online canadian pharmacy online pet pharmacy canadian pharmacy cialis


2022/09/14 14:32:38

plaxawsさん

nolvadex while on cycle


2022/09/14 14:13:10

AlvinJowさん

Thanks. I value it.
help me write a essay https://flowleadsua.com/ pre written essays for sale


2022/09/14 23:35:59

Michaelpedさん

Perfectly expressed certainly! .
best online pharmacies no prescription canadian drugs without prescription canada prescription plus pharmacy https://rxpharmacyteam.com


2022/09/15 02:47:35

AlvinJowさん

You actually suggested this very well.
your essay writer essay helper online i need an essay written for me


2022/09/15 07:12:14

MavisOaOaさん

best free online dating sites
free online dating service
online dating


2022/09/15 16:02:07

AlvinJowさん

Regards! Very good stuff.
admissions essay help write my essay help write personal statement


2022/09/15 17:46:50

AlvinJowさん

Nicely put. Kudos.
writing a three paragraph essay essay why i want to go to college help writing a thesis statement


2022/09/15 17:58:46

BruceCandyさん

You suggested it terrifically.
canadian pharmacies shipping to usa walgreens pharmacy pharmacy online


2022/09/16 02:12:53

Michaelpedさん

With thanks! I appreciate it!
canadian online pharmacy canada discount drug pharmacies near me https://canadianpharmacylist.com


2022/09/16 04:55:23

AlvinJowさん

Fantastic posts, Thanks a lot.
learning how to write an essay https://englishessayhelp.com/ write my annotated bibliography


2022/09/16 06:25:41

Wendellunapsさん

Wow plenty of useful advice!
prescription price comparison mail order pharmacies pharmacie canadienne


2022/09/16 06:37:05

AlvinJowさん

Thanks a lot! Great information!
essay writing tip https://freshapps.space/ writers help online


2022/09/16 08:24:16

JuanitaOaOaさん

best dating site usa
shemale dating
best online dating service


2022/09/16 15:37:13

leagreeさん

doxycycline empty stomach cefuroxime will increase the level or effect of enoxaparin by anticoagulation.


2022/09/16 17:12:42

AlvinJowさん

Whoa a lot of helpful information.
why us college essay college essays on diversity help with assignment writing


2022/09/16 17:47:46

AlvinJowさん

Good stuff. Kudos!
high school vs college essay compare and contrast https://orangepornhub.com/ custom speech writing services


2022/09/17 09:20:38

MaisieOaOaさん

plenty fish free dating
datiing websites
online dating best sites free


2022/09/17 17:55:10

Michaelpedさん

Incredible tons of valuable material.
generic viagra online pharmacy cheap drugs canada online pharmacy https://online-pharmacy-inc.com


2022/09/17 21:22:35

AlvinJowさん

Incredible a lot of valuable info.
college research essay urgent custom essays professional ghostwriting services


2022/09/17 22:17:19

Wendellunapsさん

You actually reported this adequately.
drugs without prescription no prescription pharmacy best canadian prescription prices



コメントを投稿する


お名前


コメント内容





TOP back