Skip to content

Inject library instance to keyword class instances #8

@MarkusBernhardt

Description

@MarkusBernhardt

IMHO the AnnotationLibrary should inject its instance to the created keyword class instances. At the moment we have to use an ugly static member variable for that:

public class Selenium2Library extends
        org.robotframework.javalib.library.AnnotationLibrary {

    /**
     * The last created instance of this library. Since the scape of this 
     * library is GLOBAL and RobotFramework executes all tests single
     * threaded, this is ok. 
     */
    protected static Selenium2Library instance;

    public Selenium2Library() {
        super(keywordPatterns);
        instance = this;
    }
}

Any thoughts about that?

Thumbs up for your great work,
Markus

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