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

Method ReplaceTransferredElementResult

cpp/iedriver/AsyncScriptExecutor.cpp:279–302  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277 return WD_SUCCESS;
278}
279void AsyncScriptExecutor::ReplaceTransferredElementResult(std::string original_element_id,
280 std::string element_id,
281 Json::Value* result) {
282 if (result->isArray()) {
283 for (Json::ArrayIndex i = 0; i < result->size(); ++i) {
284 this->ReplaceTransferredElementResult(original_element_id,
285 element_id,
286 &((*result)[i]));
287 }
288 } else if (result->isObject()) {
289 if (result->isMember(JSON_ELEMENT_PROPERTY_NAME) &&
290 (*result)[JSON_ELEMENT_PROPERTY_NAME] == original_element_id) {
291 (*result)[JSON_ELEMENT_PROPERTY_NAME] = element_id;
292 } else {
293 std::vector<std::string> member_names = result->getMemberNames();
294 std::vector<std::string>::const_iterator it = member_names.begin();
295 for (; it != member_names.end(); ++it) {
296 this->ReplaceTransferredElementResult(original_element_id,
297 element_id,
298 &((*result)[*it]));
299 }
300 }
301 }
302}
303
304int AsyncScriptExecutor::GetManagedElement(const std::string& element_id,
305 ElementHandle* element_wrapper) const {

Callers 1

Calls 2

endMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected