24
by Siam Chamnan Kit Co., Ltd. and Odd-e (Thailand) Co, Ltd. SPRINT3R Robot Framework somkiat.cc 1

Barcamp Bangkhen :: Robot Framework

Embed Size (px)

DESCRIPTION

Robot framework at Barcamp Bangkhen

Citation preview

Page 1: Barcamp Bangkhen :: Robot Framework

by Siam Chamnan Kit Co., Ltd. and Odd-e (Thailand) Co, Ltd.SPRINT3R

Robot Framework somkiat.cc

1

Page 2: Barcamp Bangkhen :: Robot Framework

Introduction• Test automation framework

• For acceptance testing (ATDD)

• https://code.google.com/p/robotframework/

• Keyword-Driven Development

• Based on Python

• Open source

• Sponsor by Nokia Siemens Networks

2

Page 3: Barcamp Bangkhen :: Robot Framework

ATDD Cycle

3

Page 4: Barcamp Bangkhen :: Robot Framework

Architecture

4

Page 5: Barcamp Bangkhen :: Robot Framework

Installation• Python 2.7/2.8

• pip

• Robot Framework

• Selenium for Robot Framework

5

Page 6: Barcamp Bangkhen :: Robot Framework

Install Robot Framework• $pip install robotframework

• $pybot

6

Page 7: Barcamp Bangkhen :: Robot Framework

Install Selenium• $pip install robotframework-selenium2library

https://code.google.com/p/robotframework-seleniumlibrary/7

Page 8: Barcamp Bangkhen :: Robot Framework

Test Structure

8

Page 9: Barcamp Bangkhen :: Robot Framework

Standard Libraries• Build in

• Operating System

• Screenshot

• Telnet

• String

• Collections

• Remote

• Dialog

• XML

• Process

http://robotframework.org/#test-libraries

Page 10: Barcamp Bangkhen :: Robot Framework

External Libraries• Selenium2Library

• Android

• iOS

• Database

• FTP

• HTTP

• MongoDB

• SSH

• AutoItLibrary

• Swing

http://robotframework.org/#test-libraries

Page 11: Barcamp Bangkhen :: Robot Framework

Selenium Keyword• Open Browser <url> <browser>

• Input Text <locator> <value>

• Click Button <locator>

• Click Link <locator>

• Close Browser

11

Page 12: Barcamp Bangkhen :: Robot Framework

Selenium Keyword• Wait Until Page Contains <text>

• Page Should Contain <text>

• Title Should Be <text>

12

Page 13: Barcamp Bangkhen :: Robot Framework

More

13

http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html

Page 14: Barcamp Bangkhen :: Robot Framework

Hello Robot• Create file hello.txt

• Run with

• $pybot hello.txt

14

Page 15: Barcamp Bangkhen :: Robot Framework

Be careful

• Page Should Contain Google

4 spacebars

only 1 spacebar

15

Page 16: Barcamp Bangkhen :: Robot Framework

Report

16

Page 17: Barcamp Bangkhen :: Robot Framework

Report

17

Page 18: Barcamp Bangkhen :: Robot Framework

Workshop• Create test case with Robot Framework

• Demo Login

18

Page 19: Barcamp Bangkhen :: Robot Framework

SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance

Feature ฟ้าประทาน

Page 20: Barcamp Bangkhen :: Robot Framework

SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance

Feature ฟ้าประทาน

http://localhost:7272/html

name=username_field

name=password_field

name=login_button

Page 21: Barcamp Bangkhen :: Robot Framework

SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance

ผ่าน คือ อะไร

username=demo

password=mode

http://localhost:7272/html/welcome.html

http://localhost:7272/html

Page 22: Barcamp Bangkhen :: Robot Framework

ความต้องการัดล่ะ

SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance

Page 23: Barcamp Bangkhen :: Robot Framework

เขียน Acceptance Test กันเถอะ

SPRINT3R Siam Chamnankit Co., Ltd., Odd-e (Thailand) Co., Ltd. and Alliance

Page 24: Barcamp Bangkhen :: Robot Framework

Question ?

24