Skip to content

Evaluate: Using nested modules like modules=rootmodule.submodule does not work #3355

Closed

Description

@pekkaklarck

Currently this usage fails:

${options} =     Evaluate    selenium.webdriver.ChromeOptions()
...              modules=selenium.webdriver

The reason is that although module selenium.webdriver is imported and available in the evaluation namespace, the selenium root module isn't added to the namespace.

Notice also that only importing only selenium doesn't work either because the selenium module doesn't automatically import the webdriver submodule. This has been discussed in a bit more detail in comments of issue #3349 and originally in comments of #3179.

A workaround is importing both selenium and selenium.webdriver:

${options} =     Evaluate    selenium.webdriver.ChromeOptions()
...              modules=selenium, selenium.webdriver

We should enhance Evaluate so that if you specify explicit modules that are nested, it will make also parent modules available in the evaluation namespace. After that fix the first example will work (and the latter continues to work). That change also makes the explicit modules argument useful after #3349 adds the automatic module import support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions