Skip to content

[py] Fix possible TypeError in expected conditions #15891

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 13, 2025

Conversation

ShauryaDusht
Copy link
Contributor

@ShauryaDusht ShauryaDusht commented Jun 12, 2025

💥 What does this PR do?

Fixes possible TypeError in text_to_be_present_in_element_value in py/selenium/webdriver/support/expected_conditions.py. This could occur if get_attribute returns None.

🔄 Types of changes

  • Bug fix (backwards compatible)

PR Type

Bug fix


Description

• Add null check for element text attribute

@selenium-ci selenium-ci added C-py Python Bindings B-support Issue or PR related to support classes labels Jun 12, 2025
@selenium-ci
Copy link
Member

Thank you, @ShauryaDusht for this code suggestion.

The support packages contain example code that many users find helpful, but they do not necessarily represent
the best practices for using Selenium, and the Selenium team is not currently merging changes to them.

We actively encourage people to add the wrapper and helper code that makes sense for them to their own frameworks.
If you have any questions, please contact us

Copy link
Contributor

qodo-merge-pro bot commented Jun 12, 2025

PR Code Suggestions ✨

No code suggestions found for the PR.

@cgoldberg cgoldberg reopened this Jun 12, 2025
Copy link
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

@cgoldberg
Copy link
Contributor

Fixes mypy type errors in the following files

This is more of a bug fix and doesn't address any type issues, right?

@ShauryaDusht
Copy link
Contributor Author

This is more of a bug fix and doesn't address any type issues, right?

Yes, it is a bug fix

Also, I wanted to ask do changes in this file appear py/selenium/webdriver/common/action_chains.py as I can't see any in PR ?

@cgoldberg
Copy link
Contributor

I wanted to ask do changes in this file appear py/selenium/webdriver/common/action_chains.py as I can't see any in PR ?

Your branch doesn't contain the changes to action_chains.py from your initial PR, but I don't see them being removed in your last commit. Where did they go? That's weird. I guess update your branch with the changes again.

@cgoldberg
Copy link
Contributor

Figured it out.. You already made the change to action_chains.py in your last PR:

6e0c875

So when I merged trunk into your branch, that was already there.

Please update this PR title and description to reflect the current changes.

@cgoldberg cgoldberg self-requested a review June 13, 2025 13:38
@ShauryaDusht ShauryaDusht changed the title [py] Fix : mypy type errors - 3 [py] Fix : mypy type errors in 2 files Jun 13, 2025
@ShauryaDusht
Copy link
Contributor Author

I have updated the title and description. Thanks!

@ShauryaDusht ShauryaDusht changed the title [py] Fix : mypy type errors in 2 files [py] Fix : mypy type errors selenium/webdriver/support/expected_conditions.py Jun 13, 2025
@cgoldberg cgoldberg changed the title [py] Fix : mypy type errors selenium/webdriver/support/expected_conditions.py [py] Fix possible TypeError in expected conditions Jun 13, 2025
@cgoldberg
Copy link
Contributor

I updated your PR title and description. This is just a bug fix, not an adjustment to type hints.

@SeleniumHQ SeleniumHQ deleted a comment from qodo-merge-pro bot Jun 13, 2025
@ShauryaDusht
Copy link
Contributor Author

Thanks for the clarification and updating the title/description.

@cgoldberg cgoldberg merged commit babd957 into SeleniumHQ:trunk Jun 13, 2025
25 of 29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-support Issue or PR related to support classes C-py Python Bindings Review effort 2/5
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants