1

My Robot file:

*** Settings ***
Library         example


*** Test cases ***

testcase1: testcase2 - configure router for admins
    keyword1
    keyword2
    keyword3
    keyword4

In the above robot file, I have two testcases (testcase1 and testcase2). If I run the above robot file, its giving me the logs saying that "Total number of testcases passed is 1"

But I want to print number of testcases as two in logs.

If i try the following file its shows testcase1 contains no keywords.

testcase1:- configure router for admins
testcase2: - configure router for admins
    keyword1
    keyword1
    keyword2
    keyword3
    keyword4

please let me know if there is a way to do this.

1 Answer 1

2

Short answer: there is no way to do what you want. At least, not in the syntax that you want. Robot is behaving as expected and documented.

In the first example you have a single test case named testcase1: testcase2 - configure router for admin. In the second example you have two test cases, but the first test case ends when the second begins, meaning the first has no keywords.

If you want two test cases that do exactly the same thing, the solution is to put all the code of the test case in a keyword, and then call the keyword from both test cases:

*** Keywords ***
Configure router for admins
    keyword1
    keyword2
    ...

*** Test cases ***
testcase1
    Configure router for admins

testcase2
    Configure router for admins
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.