0

I would like to know if there is anyway to create multiple Test Temapltes in single robot file.

*** Settings ***
Test Template    Login with invalid credentials should fail
Test Template    Open Browser


*** Test Cases ***                USERNAME         PASSWORD
Invalid User Name                 invalid          ${VALID PASSWORD}
Invalid Password                  ${VALID USER}    invalid

Chrome                            ${URL1}
Chrome                            ${URL2}
Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
Anil
  • 1
  • 2

1 Answers1

1

You can use test templates in test cases, which will turn them into this data-driven approach.

Example would be:

*** Test Cases ***
Test Case 1
    [Template]    ${first} plus ${second} equals ${expected}
    1    1    2
    1    2    3

Test Case 2
    [Template]    ${first} minus ${second} equals ${expected}
    1    1    0
    5    2    3

You should also read Test Templates section in the official documentation.

pavelsaman
  • 7,399
  • 1
  • 14
  • 32
  • Agreed, i would like consider each data set to be 1 test case. like above i need to generate report with 4 test cases passed where as now generate only 2 test cases. – Anil Jun 05 '20 at 10:47