{"id":8601,"library":"robotframework-faker","title":"Robot Framework Faker Library","description":"robotframework-faker is a Robot Framework keyword library that acts as a wrapper for the popular Faker Python library, enabling easy generation of fake test data within Robot Framework test suites. The current version is 6.0.0, supporting Python 3.9 through 3.13. Releases are made as needed, often coinciding with significant changes in the underlying Faker library or Robot Framework compatibility updates.","status":"active","version":"6.0.0","language":"en","source_language":"en","source_url":"https://github.com/marketsquare/robotframework-faker","tags":["robot framework","faker","test data","automation","testing"],"install":[{"cmd":"pip install robotframework-faker","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core dependency for fake data generation. Starting with v6.0.0, `robotframework-faker` no longer pins the `Faker` version, requiring users to manage its compatibility.","package":"Faker","optional":false},{"reason":"The library is a wrapper for Robot Framework.","package":"robotframework","optional":false}],"imports":[{"note":"robotframework-faker is a Robot Framework library, imported directly within Robot Framework's `*** Settings ***` section using the `Library` keyword, not as a standard Python import.","wrong":"from robotframework_faker import FakerLibrary","symbol":"FakerLibrary","correct":"*** Settings ***\nLibrary    FakerLibrary"}],"quickstart":{"code":"--- example.robot ---\n*** Settings ***\nLibrary    FakerLibrary    locale=en_US\nDocumentation    Example of using Robot Framework Faker Library\n\n*** Test Cases ***\nGenerate a Fake Name and Address\n    ${name}=    FakerLibrary.Name\n    Log To Console    Generated Name: ${name}\n\n    ${address}=    FakerLibrary.Address\n    Log To Console    Generated Address: ${address}\n\nGenerate Multiple Words\n    ${words_5}=    FakerLibrary.Words    nb=5\n    Log To Console    5 Words: ${words_5}\n\n--- To run ---\npip install robotframework robotframework-faker\nrobot example.robot","lang":"robotframework","description":"This quickstart demonstrates how to import `FakerLibrary` with a specified locale and use some basic keywords like `Name`, `Address`, and `Words` to generate fake data within a Robot Framework test case."},"warnings":[{"fix":"Ensure your project uses Python 3.x (3.9-3.13 for v6.0.0).","message":"Version 5.0.0 removed support for Python 2.7, aligning with the upstream Faker library's move to Python 3.","severity":"breaking","affected_versions":"5.0.0 and newer"},{"fix":"Update your build scripts or CI/CD pipelines to use modern Python packaging APIs, if you were directly interacting with `pkg_resources` in relation to this library.","message":"Version 6.0.0 removed the `pkg_resources` API, which was deprecated in Setuptools. This may affect specific build or deployment environments that relied on it. [cite: v6.0.0 release notes]","severity":"breaking","affected_versions":"6.0.0 and newer"},{"fix":"Explicitly install and pin a compatible `Faker` version (e.g., `pip install Faker==x.y.z`) in your project's dependencies to ensure consistent behavior. Consult `Faker`'s documentation for compatibility with your Python version.","message":"Starting with v6.0.0, `robotframework-faker` no longer pins the version of its underlying `Faker` package. This means the user is responsible for ensuring `Faker` is installed and that its version is compatible with the `FakerLibrary` keywords being used. Mismatched versions can lead to unexpected behavior or missing keywords.","severity":"gotcha","affected_versions":"6.0.0 and newer"},{"fix":"Call FakerLibrary keywords within `*** Test Cases ***` or `*** Keywords ***` sections. For suite-level dynamic data, use a `Suite Setup` keyword to generate and set variables using `Set Suite Variable`.","message":"FakerLibrary keywords cannot be directly called within Robot Framework's `*** Variables ***` section. This section is for static assignments, not for executing dynamic keywords that generate data at runtime.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Ensure `robotframework-faker` is installed: `pip install robotframework-faker`. Double-check the spelling in your Robot file: `Library    FakerLibrary`.","cause":"The `robotframework-faker` package is not installed in the Python environment where Robot Framework is running, or there's a typo in the library import statement.","error":"[ ERROR ] Error in file 'mytest.robot' on line X: Importing test library 'FakerLibrary' failed: ModuleNotFoundError: No module named 'FakerLibrary'"},{"fix":"Check the `robotframework-faker` GitHub issues for updates on Robot Framework 7.x compatibility. Temporarily, consider downgrading Robot Framework to a previous stable version (e.g., 6.1.1) if the issue is urgent.","cause":"This specific error often indicates a compatibility issue between `FakerLibrary` and newer versions of Robot Framework (e.g., 7.0.0+), potentially related to changes in Robot Framework's internal keyword loading or `Faker`'s data structures.","error":"[ ERROR ] Error in library 'FakerLibrary': Adding keyword 'ean8' failed: Union cannot be empty."},{"fix":"Verify `pip list` shows `robotframework-faker` and `Faker` in the active environment. Ensure Robot Framework is executed from the same Python environment where these libraries are installed. Confirm your Python version is within the supported range (3.9-3.13 for `robotframework-faker` v6.0.0).","cause":"The library might be installed, but Robot Framework cannot locate it due to an incorrect Python environment, incompatible Python versions, or a corrupted installation.","error":"Importing test library 'FakerLibrary' failed: ... (generic import failure or 'contains no keywords')"}]}