1

Consider the following data driven test case:

TC001_Sign_in_test
    [Documentation]     testing sign in with various credentials.
    [Teardown]          ${None}
    [Template]          attempt sign in and check status
    ${corr_usrnm}       ${corr_pswd}        ${welcome_screeen}
    ${corr_usrnm}       ${mispld_pswd}      ${sign_in_error_label}
    ${corr_usrnm}       ${EMPTY}            ${sign_in_error_label}
    ${EMPTY}            ${corr_pswd}        ${sign_in_error_label}
    ${mispld_usrnm}     ${corr_pswd}        ${sign_in_error_label}

After my first step in the test where we login with correct username and correct password, my app is already signed in and I would like to sign out so I can work on the next incorrect password step.

I was wondering if it was possible to insert a sign out step between the correct password and incorrect password steps. I dont have to do it this way, I could put the successful step in the end and solve the problem easily or just create another separate test for successful login, but I would like to know if it was somehow possible to insert an action in between the two rows of the data table.

1 Answer 1

1

Simply add the logout step(s) to your template keyword, attempt sign in and check status. If this is a keyword imported from a library you cannot modify for some reason, you can always create a wrapper user keyword that calls this keyword and then calls the keyword(s) required to logout

Of course since not all of your tests actually make a successful login, you may have to setup a condition based on the expected status passed to your template keyword.

Sign up to request clarification or add additional context in comments.

1 Comment

That is a good way of doing it, that I had not thought about previously. But does it mean there is no way to add a procedural step inside the data table by using something of the sort of an escape character?

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.