Skip to content

Conversation

@cgoldberg
Copy link
Member

@cgoldberg cgoldberg commented Dec 23, 2025

User description

💥 What does this PR do?

#15697

This PR improves the type hints on all of find_element/find_elements methods. It also fixes an incorrect type hint on the value arg in these methods for shadowroot.

This also updates the docstring in shadowroot/webelement that mentionRelativeBy since that is not supported in those methods.

🔄 Types of changes

  • Cleanup (formatting, renaming)
  • Bug fix (backwards compatible)

PR Type

Enhancement, Bug fix


Description

  • Fix value parameter type hint from str to str | None in shadowroot

  • Update return type hints to use modern generic syntax (list[WebElement])

  • Improve type safety across find_element/find_elements methods

@selenium-ci selenium-ci added the C-py Python Bindings label Dec 23, 2025
@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Dec 23, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@SeleniumHQ SeleniumHQ deleted a comment from qodo-code-review bot Dec 23, 2025
@cgoldberg cgoldberg requested review from navin772 and removed request for navin772 December 27, 2025 02:46
@cgoldberg cgoldberg merged commit f4240d3 into SeleniumHQ:trunk Dec 28, 2025
23 checks passed
@cgoldberg cgoldberg deleted the py-find-element-type-hints branch December 28, 2025 14:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants