Skip to content

Latest commit

 

History

History
93 lines (70 loc) · 2.6 KB

debugging.adoc

File metadata and controls

93 lines (70 loc) · 2.6 KB

Helpers: Documentation & Debugging

Table of Contents

QWeb has two helper features to aid you while creating test automation scripts. It contains a command-line interface to display keyword documentation and is integrated to robotframework-debugger / rfdebug for stopping the execution and turning on debugging when needed.

Command-line interface

QWeb’s command-line interface guarantees you always have access to the latest available keyword documentation. On a terminal, type:

Windows
python -m QWeb --help
Linux/Mac
python3 -m QWeb --help

…​to display commands:

❯ python -m QWeb --help
usage: python QWeb [options] INPUT

EXAMPLES:
QWeb --all (lists all keywords)
QWeb --list Get (lists all keywords startin with "Get")
QWeb --show TypeText (displays documentation for keyword "TypeText")

Note: This module is meant to be used as a robot famework library.Command line
interface only provides access to keyword documentation.

optional arguments:
  -h, --help            show this help message and exit
  -V, --version         show program's version number and exit
  -A, --all             lists ALL keywords
  -L LIST, --list LIST  lists keywords based on input string
  -S SHOW, --show SHOW  show docs for keyword(s)

Debugging

You can turn on debugging temporarily using keyword DebugOn and turn it off temporarily by using keyword DebugOff.

Debugging demo
*** Settings ***
Library         QWeb

*** Test Cases ***
Use case 1
    OpenBrowser     https://qentinelqi.github.io/shop       chrome
    VerifyText      The animal friendly clothing company
    ClickText       Scar the Lion
    ClickText       Add to cart
    VerifyText      Cart summary
    DropDown        Size                                    Large
    ClickItem       Increment quantity
    DebugOn
    ClickItem       Remove item
    VerifyText      Your cart is empty
    ClickText       Continue shopping

Run this example from repo root by:

robot ./12/demo_debug_12.robot
💡
To exit debug mode, write exit to debug terminal.
ℹ️
On next chapter you will learn a setting that turns debugging on on every failed keyword.