Introduction to Robot Framework

7,478 views

Published on

Introduction to Robot Framework

Published in: Technology
1 Comment
9 Likes
Statistics
Notes
No Downloads
Views
Total views
7,478
On SlideShare
0
From Embeds
0
Number of Embeds
559
Actions
Shares
0
Downloads
335
Comments
1
Likes
9
Embeds 0
No embeds

No notes for slide

Introduction to Robot Framework

  1. 1. by Siam Chamnan Kit Co., Ltd. and Odd-e (Thailand) Co, Ltd. SPRINT3R Acceptance Test and Acceptance-Test Driven Development with Robot Framework 1
  2. 2. 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
  3. 3. ATDD Cycle 3
  4. 4. Architecture 4
  5. 5. Installation • Python 2.7/2.8 • pip • Robot Framework • Selenium for Robot Framework 5
  6. 6. Install python (1) • Download from https://www.python.org/ • Version 2.7/2.8 • $python 6
  7. 7. Install python (2) • For Windows OS! • set PYTHON_HOME=c:python27 • set PATH=.;%PYTHON_HOME%;%PATH% 7
  8. 8. Install python (3) • Go to My Computer -> Right Click -> Properties • Choose tab Advanced 8
  9. 9. Install python (4) • Add Environment Variable • PYTHON_HOME 9
  10. 10. Install python (5) • Update Environment Variable in System • PATH 10
  11. 11. Install pip (1) • PIP = Package Installation for Python • http://www.pip-installer.org/en/latest/installing.html • Download file get-pip.py • $python get-pip.py 11
  12. 12. Install pip (2) • For Windows OS! • set PYTHON_HOME=c:python27 • set PATH=.;%PYTHON_HOME%;%PYTHON_HOME%scripts; %PATH% • Test pip • $pip 12
  13. 13. Install pip (3) • For Mac OS! • $easy_install pip • $pip 13
  14. 14. PIP with Proxy • SET HTTP_PROXY=<proxyHost>:<proxyPort> • SET HTTPS_PROXY=<proxyHost>:<proxyPort>
 
 14 • pip install --proxy="user:password@server:port" packagename
  15. 15. Install Robot Framework • $pip install robotframework • $pybot
 15
  16. 16. Install Selenium • $pip install robotframework-selenium2library https://code.google.com/p/robotframework-seleniumlibrary/16
  17. 17. Additional • Text Editor => Sublime 2 • RIDE • https://code.google.com/p/robotframework-ride/ 17
  18. 18. Sublime Config • Install Package Control • https://sublime.wbond.net/installation 18
  19. 19. Sublime Config • Install Robot Framework plug-in • Tools -> Command Palette … • Package control : Install Package • Find Robot Framework 19
  20. 20. Sublime … 20
  21. 21. Test Structure 21
  22. 22. Standard Libraries • Build in! • Operating System! • Screenshot • Telnet • String • Collections! • Remote • Dialog • XML • Process http://robotframework.org/#test-libraries
  23. 23. External Libraries • Selenium2Library! • Android • iOS • Database • FTP • HTTP • MongoDB • SSH • AutoItLibrary • Swing http://robotframework.org/#test-libraries
  24. 24. Selenium Keyword • Open Browser <url> <browser> • Input Text <locator> <value> • Click Button <locator> • Click Link <locator> • Close Browser 24
  25. 25. Selenium Keyword • Wait Until Page Contains <text> • Page Should Contain <text> • Title Should Be <text> 25
  26. 26. More 26 http://rtomac.github.io/robotframework-selenium2library/doc/Selenium2Library.html
  27. 27. Hello Robot • Create file hello.txt • Run with • $pybot hello.txt 27
  28. 28. Be careful • Page Should Contain Google 4 spacebars only 1 spacebar 28
  29. 29. Report 29
  30. 30. Report 30
  31. 31. Solve Proxy Problem • For Firefox on Windows OS! • Using Firefox profile • $c:Program FilesMoxilla Firefoxfirefox.exe -P 31
  32. 32. Solve Proxy Problem • For Firefox on Mac OS! • Using FireFox profile • $/Applications/Firefox.app/Contents/MacOS/firefox-bin -profilemanager 32
  33. 33. Solve Proxy Problem • For Firefox on Linux! • Using FireFox profile • $./firefox -profilemanager 33
  34. 34. Solve Proxy Problem • Create Profile … 34
  35. 35. Config Proxy in Firefox • Start FireFox with my profile • Configuration Proxy server in • Preferences -> Advanced -> Network 35
  36. 36. Workshop • Create test case with Robot Framework • Test www.google.com 36
  37. 37. Search with Google 37
  38. 38. Workshop • Create test case with Robot Framework • Demo Login 38
  39. 39. Support Multiple Browser • Google Chrome • Internet Explorer 39
  40. 40. Google Chrome (1) • Download Chrome Driver • https://code.google.com/p/selenium/wiki/ChromeDriver 40
  41. 41. Google Chrome (2) http://robotframework.googlecode.com/svn/trunk/doc/libraries/OperatingSystem.html#Set Environment Variable41
  42. 42. Internet Explorer (1) • Download Internet Explorer Driver • https://code.google.com/p/selenium/wiki/InternetExplorerDriver 42
  43. 43. Internet Explorer (2) http://robotframework.googlecode.com/svn/trunk/doc/libraries/OperatingSystem.html#Set Environment Variable43
  44. 44. Workshop • Create test case with Robot Framework • TODO Application • http://up1todo.appspot.com/ 44
  45. 45. Question ? 45

×