{"id":15145402,"url":"https://github.com/amochin/robotframework-eggplant","last_synced_at":"2025-10-24T00:31:23.057Z","repository":{"id":57462350,"uuid":"433771464","full_name":"amochin/robotframework-eggplant","owner":"amochin","description":"Robot Framework eggPlant Library","archived":false,"fork":false,"pushed_at":"2024-05-03T11:25:16.000Z","size":2406,"stargazers_count":6,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-27T11:24:06.037Z","etag":null,"topics":["robotframework","test-automation"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amochin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-01T09:57:04.000Z","updated_at":"2024-05-03T11:24:23.000Z","dependencies_parsed_at":"2024-05-03T12:38:44.529Z","dependency_job_id":"f5f66b18-096c-4217-807f-27b840b008ef","html_url":"https://github.com/amochin/robotframework-eggplant","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amochin%2Frobotframework-eggplant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amochin%2Frobotframework-eggplant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amochin%2Frobotframework-eggplant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amochin%2Frobotframework-eggplant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amochin","download_url":"https://codeload.github.com/amochin/robotframework-eggplant/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219867315,"owners_count":16555821,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["robotframework","test-automation"],"created_at":"2024-09-26T11:24:36.417Z","updated_at":"2025-10-24T00:31:22.630Z","avatar_url":"https://github.com/amochin.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Robot Framework eggPlant Library\n\nThis [dynamic](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#different-test-library-apis)\nlibrary for [Robot Framework](https://robotframework.org/) allows calling\n[eggPlant Functional](https://www.eggplantsoftware.com/eggplant-functional-downloads) scripts via XML RPC\nusing [eggDrive](http://docs.testplant.com/ePF/using/epf-about-eggdrive.htm).  \nIt considers **eggPlant scripts as low level keywords** and exposes them for usage in **high level keywords and test cases in Robot Framework**.  \nSo the scripts themselves have to be created in eggPlant, not in Robot Framework.\n\nThe eggPlant itself should be launched in eggDrive mode from outside -\nsee the scripts `start_eggPlant.bat` and `stop_eggPlant.bat` for example.\n\n![Architecture picture](Architecture.png)\n\nWatch my talk from [Robocon 2022](https://youtu.be/wOGVdWEzs_A)!\n\n[![Eggplant Library presentation at RoboCon 2022](http://img.youtube.com/vi/wOGVdWEzs_A/0.jpg)](https://youtu.be/wOGVdWEzs_A \"Eggplant Library presentation at RoboCon 2022\")\n\n- [Quick Start](#quick-start)\n- [eggPlant compatibility](#eggplant-compatibility)\n- [Importing library](#importing-library)\n- [Keywords](#keywords)\n- [Library usage in VS Code](#library-usage-in-vs-code)\n- [Running self-tests](#running-self-tests)\n## Quick start\n\n### System requirements\n\n- Windows (Unix not tested yet)\n- Python 3.9 or newer\n- Robot Framework\n\n#### Running tests requires additionally\n\n- eggplant 21.1.0 or newer\n- Valid eggplant license\n\nApart from test execution **you can use the eggPlant Library without eggplant and license**.  \nYou can still develop test cases and keywords and run tests in the\n[dryrun mode](https://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#dry-run).  \nYou'd need a file structure created by eggplant though -\nto let the library discover your eggplant scripts and expose them as keywords.\n\n### Installation\n\n```shell\npip install robotframework-eggplantlibrary\n```\n\n### Test case example\n\n```robotframework\n*** Settings ***\nLibrary   EggplantLibrary   suite=E:/eggPlantScripts/SuiteOne.suite    host=http://127.0.0.1   port=5400\n# Setting path to the eggplant test suite folder during library import for discovering eggplant scripts as keywords\n\nSuite Setup     Open Session\nSuite Teardown  Close Session\nTest Setup      Connect SUT    Windows_10_1\n\n*** Test Cases ***\nTest One\n    Check Input In Notepad    Hello World    Some value\n    # Calling an eggplant script as a keyword \n```\n\n### Running tests\n\n1. Start eggPlant in eggdrive mode - see the scripts `start_eggPlant.bat` and `stop_eggPlant.bat` for example\n2. Launch tests with a `robot` command as usual\n\n### Check out examples in the folder `tests`\n\n## eggPlant compatibility\n\nThe Eggplant Library is compatible with eggPlant 21.1.0 and newer versions.  \nOlder eggPlant versions may work properly sometimes, but in most cases they are incompatible\nand tests might either fail or pass unexpectedly.\n\nThe library checks the current eggplant version in the `Open Session` keyword and logs a warning\nin case of incompatibility.\n\n\u003eThere is **no backwards compatibility** with older versions due to significant changes in eggplant -\nnew lists and properties format, changed movie and screenshot commands, named params and default values etc.  \nSee Release Notes for eggplant [20](http://docs.eggplantsoftware.com/ePF/gettingstarted/epf-v20-release-notes.htm) und [21](http://docs.eggplantsoftware.com/ePF/gettingstarted/epf-v21-release-notes.htm) for more information.\n\n## Importing library\n\nEach library import is bound to a single **eggPlant test suite**, which path can be specified at library import.  \nThe library needs a file access to the ``.suite`` folder in order to get keywords (i.e. eggPlant ``.script`` files),\ntheir arguments and documentation.\n\n### Import parameters  \n\n- ``suite``: path to the eggPlant ``.suite`` file.\n  - If eggPlant runs on a remote server, input here a path from the library host, not relative to the server! And it must be reachable.  \n  - The default value is a first _.suite_ file in the library folder.  \n  - You can also select another eggPlant suite for actual execution using `Open Session` and `Close Session` keywords.\n- ``host``: host name or IP address of the eggPlant server running in the eggDrive mode.  \n  - The default value is ``http://127.0.0.1``.\n  - You can also select another host name for actual execution using `Set eggDrive Connection` keyword.\n  - **The library has been tested on localhost only!**\n  It would be a miracle if it worked just like this with a remote eggPlant server.\n- ``port``: port of the eggPlant server.\n  - The default value is ``5400``.\n  - You can also select another port for actual execution using `Set eggDrive Connection` keyword.\n- ``scripts_dir``: folder inside the eggPlant Suite, where all scripts are located.\n  - The default value is ``Scripts``.\n  - Subfolders are supported.\n\n#### Each parameter is optional and may stay unset during library import\n\nIn this case library looks for it's value in the **config file** `EggplantLib.config` in the library package dir.\nIf no value found in the config file (or no file exists), the default value is used.  \n\n### Config file example\n\n```txt\nsuite=..\\tests\\keywords\\eggPlantScripts\\SuiteOne.suite\nscripts_dir=Scripts\nhost=http://127.0.0.1\nport=5400\n```\n\n\u003eThe config file must be named `EggplantLib.config` and located in the library package dir (e.g. ``\u003cpython_dir\u003e\\lib\\site-packages\\EggplantLibrary``).  \n\nThere is no real XML RPC connection being established during the import, so it's not necessary\nto start the eggPlant server before importing the library.\n\n### Import examples\n\n```robotframework\n*** Settings ***\nLibrary    EggplantLibrary  suite=E:/eggPlantScripts/SuiteOne.suite    host=http://127.0.0.1    port=5400\nLibrary    EggplantLibrary  suite=E:/eggPlantScripts/SuiteOne.suite    host=http://127.0.0.1    port=5400    WITH NAME    MySUT\nLibrary    EggplantLibrary\n# Import without parameters needs 'EggplantLib.config' in the library package dir\n```\n\n## Keywords\n\n- Each library import is bound to a single eggPlant test suite, which path can be specified at library import.  \nThe library needs a file access to the eggPlant .suite file in order to get keywords (i.e. eggPlant .script files), their arguments and documentation.\n\n- The eggPlant scripts are exposed as keywords with script names (without .script extension) using standard RF format - e.g. ``HelloWorld.script`` is exposed as ``Hello World``.  \n\n- Scripts can be structured in **subfolders**. In this case a subfolder name is added as prefix following by a dot, e.g. ``Subfolder.Myscript``.  \nIf there are several sufolders in the structure, all of them are added as prefix, separated by a dot, e.g. ``Subfolder.SubSubfolder.Myscript``.  \n\n- The eggPlant scripts named with an underscore ('_') at the beginning are considered as **internal scripts** and would not be exposed as keywords to RF.\n\n### Keyword documentation is supported\n\nAll comments at the top of a script file are fetched as a keyword documentation and appear in code completion and libdoc.\nThe [Robot Framework documentation formatting](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#documentation-formatting) is supported:\n\n[Tags](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#keyword-tags) may be set in the last comment row [as usual](http://robotframework.org/robotframework/latest/RobotFrameworkUserGuide.html#getting-keyword-tags) in Robot Framework keyword documentation.\n\n```sensetalk\n# This is my eggPlant sctipt documentation.\n// I can use single line comments \n-- with #, // and --\n(* And multiline comments\nFormatting supported: *bold*, _italic_, List:\n- One\n- Two\n\nRobotFramewok tags are supported as well:\nTags: first, second\n*)\n```\n\n### Static keywords\n\nThe library also contains several built in keywords (independent from actually available eggPlant scripts) for taking screenshots, opening and closing eggPlant sessions and connections to eggDrive and SUT.\n\n### Creating keyword documentation\n\nYou can use _libdoc_ to build the keyword documentation file. This will include eggPlant scripts and static keywords as well:\n\n  ```shell\n    libdoc EggplantLibrary::\u003cFull path to eggplant suite\u003e keywords_docs.html\n  ```\n\n### Keywords accept arguments\n\nUse standard Robot Framework argument format:\n\n```robotframework\nMyScript    Arg1    String argument with spaces   \n```\n\n`In Robot Framework you don't need additional quotes for string arguments! Wrong: \"String parameter\". Right: String parameter.`\n\n- The Library tries to convert arguments from Robot Framework data types into eggPlant data types.  \n  These standard Robot Framework data types are tested snd should work: **int**, **float**, **bool**, **list**, **string**.\n- List arguments are supported, including nested lists.  \n  It is still possible to use old eggPlant list format as a string - the values are converted in proper lists. Example:\n  \n  ```robotframework\n  MyScriptForListParams     (\"first\", \"second\", \"third\")\n  ```\n\n- [Named parameters](http://docs.eggplantsoftware.com/ePF/SenseTalk/stk-parameters-and-results.htm#named-params) and [default argument values](http://docs.eggplantsoftware.com/ePF/SenseTalk/stk-handlers.htm#default-values) are supported (support in eggplant added in 21.0.0)\n  - eggPlant script example:\n\n    ```sensetalk\n    params positional_arg_no_default, arg_int:123, arg_bool:True, arg_string:\"hello\", arg_string_with_space:\"hello world\"\n    ```\n\n  - Robot Framework usage example:\n\n    ```robotframework\n    My keyword  some value\n    My keyword  some value  arg_int=${456}\n    My keyword  some value  arg_bool=${False}\n    My keyword  some value  arg_string=Skywalker\n    My keyword  some value  arg_string_with_space=I am your father\n    ```\n\n### Keywords may return values\n\nAll **eggPlant scripts** are executed using [RunWithNewResult](http://docs.testplant.com/ePF/SenseTalk/stk-script-calling.htm)\nand the _ReturnValue_ of the _Result_ section from the XML RPC response is returned.  \n\u003e Due to the usage of the _RunWithNewResult_ mode the _ReturnValue_ is always a **string**.  \nThe Library tries to convert it to one of standard Python data types.  \nThese standard Robot Framework data types are tested snd should work: **int**, **float**, **bool**, **list**.\n\nThe **static (included) keywords** are different and might call an eggPlant command directly.\nIn this case the _Result_ section from the XML RPC response is not parsed and returned directly,\nalthough it might be a result of a previous script.  \n\u003e No data type conversion is done in this case, as the _Result_ section is able to contain different types.\n\nAll eggPlant output is saved into the RF log file.\nIn case of failed execution the library takes a SUT **screenshot automatically** and embeds it into the RF log file. If **video recording** was active, it would be embedded into the log file as well.\n\n## Library usage in VS Code\n\nThe library can be used in VS Code with the\n[Robot Framework Language Server extension](https://marketplace.visualstudio.com/items?itemName=robocorp.robotframework-lsp) with most of the features supported (code completion for keywords, go to keyword source, test case run directly from VS Code etc.), but it requires some **additional setup**.\n\nBy default the Language Server Plugin for VS Code does not process import parameters of the library - i.e. all necessary initialization options can't be set in a usual way.  \nYou can solve it in one of the following ways:\n1. Enable processing library import arguments in the [Language Server Plugin configuration](https://github.com/robocorp/robotframework-lsp/blob/master/robotframework-ls/docs/config.md)\n    ```\n    //put this line into 'settings.json'\n    \"robot.libraries.libdoc.needsArgs\": [\"EggplantLibrary\"]\n    ```\n2. Alternatively you can use the [config file](#config-file-example) to specify library parameters.\n    - You don't have to change the existing library import with parameters in RF test suite files -\n   VS code processes the import, but ignores the parameters.\n    - Direct library import parameters in RF files always have a higher pirority than config file values.\n    - You may use only some of import parameters - both in RF files and in a config file.  \n\nThere is no need to reload VS Code after adding or changing eggplant script files - the Language Server extension should detect the changes and update the keyword names for code completion automatically.     \nIf you're having issues with it, try to regenerate the library specification files - just delete the `EggplantLibrary\u003c...\u003e.libspec` and `EggplantLibrary\u003c...\u003e.libspec.m` files in the LanguageServer specs folder - usually located somewhere in `\u003cuser_profile\u003e/.robotframework-ls/specs/\u003c...\u003e/user`.\n\n\nNote that importing library directly as a python file via path doesn't work for VS Code -\ninstead you should use module name with the correct `robot.pythonpath` in the Language Server extension settings.  \nIt shouldn't be a problem when installing library as a normal user,\nbut might be necessary for library development and maintenance.\n\n## Running self-tests\nRunning self-tests ist especially useful during debugging or modifying the library.   \nYou need a **running eggPlant instance** to run tests - means you need an **eggplant license**.\n\nMost of the tests don't need a real SUT connection and use a **screenshot SUT** instead.\nThe only tests which require a real working RDP/VNC connection have the _real_SUT_needed_ tag.   \nSo you can use the following command:\n```\nrobot --exclude real_SUT_needed tests\n```\n **Without valid license or eggPlant instance running** you can still run the tests in the **dryrun** mode - it allows to check the library in general and the getting keywords functionality.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famochin%2Frobotframework-eggplant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famochin%2Frobotframework-eggplant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famochin%2Frobotframework-eggplant/lists"}