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

Method Serialize

cpp/webdriver-server/command.cc:90–109  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88}
89
90std::string Command::Serialize() {
91 LOG(TRACE) << "Entering Command::Serialize";
92 Json::Value json_object;
93 json_object["name"] = this->command_type_;
94 if (this->session_id_.length() == 0) {
95 json_object["sessionId"] = Json::nullValue;
96 } else {
97 json_object["sessionId"] = this->session_id_;
98 }
99 Json::Value parameters_object(Json::objectValue);
100 ParametersMap::const_iterator it = this->command_parameters_.begin();
101 ParametersMap::const_iterator end = this->command_parameters_.end();
102 for (; it != end; ++it) {
103 parameters_object[it->first] = it->second;
104 }
105 json_object["parameters"] = parameters_object;
106 Json::StreamWriterBuilder writer;
107 std::string output(Json::writeString(writer, json_object));
108 return output;
109}
110
111void Command::Copy(const Command& source) {
112 this->command_type_ = source.command_type_;

Callers 15

OnWaitMethod · 0.45
OnBrowserCloseWaitMethod · 0.45
OnSessionQuitWaitMethod · 0.45
OnScriptWaitMethod · 0.45
DispatchCommandMethod · 0.45
GetStatusMethod · 0.45
DispatchCommandMethod · 0.45
ListSessionsMethod · 0.45
ToJsonMethod · 0.45
CommandClass · 0.45
SendCommandMethod · 0.45
WriteMethod · 0.45

Calls 3

endMethod · 0.80
LOGClass · 0.70
lengthMethod · 0.65

Tested by

no test coverage detected