Skip to content

Commit 1023f55

Browse files
committed
Add note on stale element checks and a WebElement represents a DOM element
1 parent 7f7a5af commit 1023f55

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

py/selenium/webdriver/remote/webelement.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2008-2013 Software freedom conservancy
1+
# Copyright 2008-2014 Software freedom conservancy
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
16-
"""WebElement implementation."""
1715
import hashlib
1816
import os
1917
import zipfile
@@ -23,24 +21,31 @@
2321
from io import BytesIO as IOStream
2422
import base64
2523

26-
2724
from .command import Command
2825
from selenium.common.exceptions import WebDriverException
2926
from selenium.common.exceptions import InvalidSelectorException
3027
from selenium.webdriver.common.by import By
3128
from selenium.webdriver.common.keys import Keys
3229

30+
3331
try:
3432
str = basestring
3533
except NameError:
3634
pass
3735

3836

3937
class WebElement(object):
40-
"""Represents an HTML element.
38+
"""Represents a DOM element.
39+
40+
Generally, all interesting operations to do with interacting with a
41+
document will be performed through this interface.
42+
43+
All method calls will do a freshness check to ensure that the element
44+
reference is still valid. This essentially determines whether or not the
45+
element is still attached to the DOM. If this test fails, then an
46+
`StaleElementReferenceException` is thrown, and all future calls to this
47+
instance will fail."""
4148

42-
Generally, all interesting operations to do with interacting with a page
43-
will be performed through this interface."""
4449
def __init__(self, parent, id_):
4550
self._parent = parent
4651
self._id = id_

0 commit comments

Comments
 (0)