Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Scripting robot

Create test cases and run with robot framework to do automated test.

  • Sé el primero en comentar

Scripting robot

  1. 1. @chonla Aloha! September 25, 2014
  2. 2.  Test data format  Editor  Structure  Syntax  Setup and Tear down Keyword Addressing element Create a simple test case  Running your test cases  Data driven test case  Try it yourselves Q&A
  3. 3. Test cases are in test case files. Test case file format can be • HTML • TSV (Tab Separated Values) • Plain Text (This slide covers only this format)
  4. 4. RIDE (https://pypi.python.org/pypi/robotframework-ride) • GUI and easy Text Editor • Simple and fast
  5. 5. Data table • Test cases (Required) • Settings • Keywords • Variables Table header is written after * character • *** Test cases *** • *** Test cases • *Test cases
  6. 6. Spacing does matter. Argument/Value separator • At least 2 spaces • | (pipe) Comment • Use # Test Keyword 1 2 Test Keyword | 1 | 2 #This is comment text
  7. 7. Variable is written as ${VariableName} Passing parameters to Keyword • Keyword | Parameter 1 | Parameter 2 • Don’t forget | and spaces are equal.
  8. 8. Settings : Suite Setup/Suite Teardown Settings : Test Setup/Test Teardown Test Cases : [Setup]/[Teardown] Keywords : [Teardown]
  9. 9. Keywords are written under table Keywords  List of built-in keywords • http://rtomac.github.io/robotframework-selenium2library/ doc/Selenium2Library.html
  10. 10. identifier=element (id/name) id=element (id) name=element (name) xpath=query (xpath) dom=DOM (DOM expression) link=href (anchor) css=selector (CSS selector) jquery=selector (jQuery selector) sizzle=selector (sizzle selector) tag=HTMLTag (HTML Tag)
  11. 11. What library is required? • Selenium2Library
  12. 12. Use pybot <TestCaseFilename> Result of testing : report.html Log of testing : log.html XML Output : output.xml
  13. 13. [Template] is a key of data driven test case. Create test cases with test data. Tell robot to use a keyword as a template of test data.
  14. 14. Scenario 1 • You are about to search for something in Google. You have to open your browser. Type in your keyword and click search and verify the result should contain your query. Scenario 2 • Use robot to post facebook and verify page should contain your new post.
  15. 15. Enjoy automating!

×