MCPcopy Create free account
hub / github.com/SeleniumHQ/selenium / IsElementManaged

Method IsElementManaged

cpp/iedriver/ElementRepository.cpp:73–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73bool ElementRepository::IsElementManaged(IHTMLElement* element,
74 ElementHandle* element_wrapper) {
75 // TODO: This method needs much work. If we are already managing a
76 // given element, we don't want to assign it a new ID, but to find
77 // out if we're managing it already, we need to compare to all of
78 // the elements already in our map, which means iterating through
79 // the map. For long-running tests, this means the addition of a
80 // new managed element may take longer and longer as we have no
81 // good algorithm for removing dead elements from the map.
82 ElementMap::iterator it = this->managed_elements_.begin();
83 for (; it != this->managed_elements_.end(); ++it) {
84 if (it->second->element() == element) {
85 *element_wrapper = it->second;
86 return true;
87 }
88 }
89 return false;
90}
91
92void ElementRepository::RemoveManagedElement(const std::string& element_id) {
93 LOG(TRACE) << "Entering ElementRepository::RemoveManagedElement";

Callers 1

AddManagedElementMethod · 0.95

Calls 2

endMethod · 0.80
elementMethod · 0.45

Tested by

no test coverage detected