How to check if a webelement has attribute in Python? or What's the best way to verify a webelement h

16 Replies, 703 Views

You could also use `get_property()` instead of `get_attribute()` in some cases—depends on the attribute.

For webelement has attribute python, it’s worth checking both if `get_attribute()` isn’t giving you what you expect.

Example:
```python
value = element.get_property('value') # might differ from get_attribute('value')
```

Not exactly what you asked, but good to know!

Messages In This Thread



Users browsing this thread: 1 Guest(s)