selenium icon indicating copy to clipboard operation
selenium copied to clipboard

[py] Element to be Clickable Expansion

Open maxtheaxe opened this issue 5 years ago • 3 comments

🚀 Feature Proposal

Add the ability to pass an element to element_to_be_clickable(), rather than just a locator.

Motivation

It would add convenience. This feature already exists in the Java version, but does not in Python (as far as I can tell according to the docs).

Example

I'm currently trying to dynamically scroll a page until a certain number of elements exist (found using a while loop and xpath), but I want to be sure they've all fully loaded before I start operating on them. Thus, I'm currently trying to pass the last element in the list of (partially-loaded) elements in as my expected condition, and wait until it's clickable, but that's not directly possible.

maxtheaxe avatar Apr 11 '21 03:04 maxtheaxe

Added a pull request with the necessary code--should be reviewed carefully because I've never done this before.

maxtheaxe avatar Apr 11 '21 04:04 maxtheaxe

Should instead check if argument is a Tuple or WebElement, proceed as necessary (#9374). All of expected_conditions needs to be updated to pare down duplicate functions (separated by arg type), do this check instead. Thus, will create separate issue representative of generalized problem.

maxtheaxe avatar Apr 12 '21 16:04 maxtheaxe

I see the PR was merged, closing this.

diemol avatar Apr 21 '21 19:04 diemol