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

Method LookupCommand

cpp/webdriver-server/server.cc:683–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

681}
682
683std::string Server::LookupCommand(const std::string& uri,
684 const std::string& http_verb,
685 std::string* session_id,
686 std::string* locator) {
687 LOG(TRACE) << "Entering Server::LookupCommand";
688
689 std::string value = webdriver::CommandType::NoCommand;
690 std::vector<std::string> url_fragments;
691 UriInfo::ParseUri(uri, &url_fragments, NULL);
692 UrlMap::const_iterator it = this->commands_.begin();
693 for (; it != this->commands_.end(); ++it) {
694 std::vector<std::string> locator_param_names;
695 std::vector<std::string> locator_param_values;
696 if (it->second->IsUriMatch(url_fragments,
697 &locator_param_names,
698 &locator_param_values)) {
699 if (it->second->HasHttpVerb(http_verb, &value)) {
700 std::string param = this->ConstructLocatorParameterJson(
701 locator_param_names, locator_param_values, session_id);
702 locator->append(param);
703 } else {
704 locator->append(it->second->GetSupportedVerbs());
705 }
706 break;
707 }
708 }
709 return value;
710}
711
712std::string Server::ConstructLocatorParameterJson(
713 std::vector<std::string> locator_param_names,

Callers 1

DispatchCommandMethod · 0.95

Calls 7

endMethod · 0.80
IsUriMatchMethod · 0.80
HasHttpVerbMethod · 0.80
GetSupportedVerbsMethod · 0.80
LOGClass · 0.70
appendMethod · 0.45

Tested by

no test coverage detected