Skip to content

Allow extending SeleniumLibrary by creating plugin API.  #1292

@aaltat

Description

@aaltat

It's already possible to extend SeleniumLibrary from other library or listener by adding new classes. For more details, see https://github.com/robotframework/SeleniumLibrary/blob/master/docs/extending/examples/modify_seleniumlibrary/NewKeywords.py Although this is useful, it can not be done from Robot Framework test data. Therefore, example IDE can not know that new keywords are added and existing keywords are modified. Because of this limitation, it would be useful to allow the same thing also happen in library import and perhaps also with keyword. Example something like this:

| Library | SeleniumLibrary | extension=MyClass,OtherClass |

In the above example , is separator for the classes.

Also arguments should be supported:

| Library | SeleniumLibrary | extension=MyClass;arg1;arg2 |

In the above example ; is separator for the arguments. Arguments will be passed as strings and conversion to different types will not be done by the SeleniumLibrary. Also support named arguments and variable number of arguments is useful.

Example if plugin looks like this:

class PluginWithAllArgs(LibraryComponent):

         def __init__(self, ctx, arg, *varargs, **kwargs):

Then import could look like this:

| Library | SeleniumLibrary | extension=PluginWithAllArgs.py;argument1;varg1;varg2;kw1=kwarg1;kw2=kwarg2

It should be allowed to import class from module search path or with file name.

It must be only allowed to import class, adding methods from modules are not supported. In short the class should look similar to classes which are implementing SeleniumLibrary keywords.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions