Skip to content

Using __init__.robot file with RoboSAPiens #31

Open
@vadurk

Description

@vadurk

Hello again, it's me :)

I came across a strange issues: I'm trying to introduce init.robot file for initializing some stuff before each test suite (looking into minimizing duplication). So what I'm trying to do is have "login to sap" keyword in that file so it's executed before the other suites, like this:

init.robot

*** Keywords ***

Secure login
    ${log_level}       Set Log Level    NONE
    Login to SAP
    Set Log Level      ${log_level}

*** Settings ***
Resource    ./main_keywords.resource   # this is were Login to SAP comes from

Suite Setup         Secure login
Suite Teardown      Close SAP

And then under the same directory there is a Suite_A.robot

Suite_A.robot

*** Test Cases ***

TC 1
   Execute Transaction 123

So what happens when I execute the tests in tests directory (robot tests/) is that I get logged in to SAP GUI but "Execute Transaction 123" fails with:
No active SAP-Session. Call the keyword "Connect To Server" or "Connect To Running SAP" first.

So how come "Secure login" from init.robot is executed, but "Execute Transaction 123" from Suite_A.robot fails to detect that SAP is open?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions