Skip to content

Feature/add secret type#1985

Draft
yuriverweij wants to merge 10 commits into
robotframework:masterfrom
yuriverweij:feature/add-secret-type
Draft

Feature/add secret type#1985
yuriverweij wants to merge 10 commits into
robotframework:masterfrom
yuriverweij:feature/add-secret-type

Conversation

@yuriverweij
Copy link
Copy Markdown
Member

@yuriverweij yuriverweij commented May 6, 2026

Add support for the Secret type (introduced in Robot Framework 7.4) to the Input Text and Input Password keywords, ensuring sensitive values can be handled securely and without accidental logging. Keeping in mind compatibility problems with older Robot Framework versions.

Secret type support and compatibility:

  • Updated Input Text and Input Password keywords in formelement.py to accept both str and Secret types, extracting the value from Secret objects as needed. This ensures that secret values are not logged and are handled securely.
  • Added a compatibility stand-in for the Secret type in utils/types.py, allowing the code to work with Robot Framework versions both before and after 7.4 by providing a minimal stand-in class if necessary.

Acceptance tests and helpers:

  • Added new acceptance tests to textfields.robot to verify that Input Text and Input Password accept the Secret type, that plain strings are still accepted for backwards compatibility, and that secret values are not logged.
  • Introduced a test tag require-rf-7.4 to skip specific Secret tests if it is not present.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Robot Framework 7.4 Secret type compatibility to SeleniumLibrary text-entry keywords so secrets can be passed without exposing values in Robot Framework logs, while maintaining compatibility with older RF versions.

Changes:

  • Added Secret import with a fallback stand-in class for Robot Framework < 7.4.
  • Updated Input Text and Input Password to accept str | Secret, extracting .value when needed.
  • Added/updated acceptance test coverage and test-runner exclusion for pre-7.4 environments.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/SeleniumLibrary/utils/types.py Adds Secret import with fallback stand-in for RF < 7.4.
src/SeleniumLibrary/keywords/formelement.py Accepts Secret in Input Text/Input Password and unwraps before send_keys; updates keyword docs.
atest/run.py Excludes require-rf-7.4 tagged tests when Robot Framework < 7.4.
atest/acceptance/keywords/textfields.robot Adds acceptance tests for Secret support and log-safety expectations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/SeleniumLibrary/keywords/formelement.py Outdated
Comment thread atest/run.py Outdated
Comment thread atest/acceptance/keywords/textfields.robot
Comment thread src/SeleniumLibrary/keywords/formelement.py Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment thread atest/run.py Outdated
Comment on lines +226 to +227
if tuple(int(x) for x in robot_version.split(".")[:2]) < (7, 4):
options.extend(["--exclude", "require-rf-7.4"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants