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

Method GetText

cpp/iedriver/Alert.cpp:181–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181std::string Alert::GetText() {
182 LOG(TRACE) << "Entering Alert::GetText";
183 std::string alert_text_value = "";
184 if (this->is_standard_control_alert_) {
185 alert_text_value = this->GetStandardDialogText();
186 } else {
187 std::string alert_text = this->GetDirectUIDialogText();
188 if (!this->is_security_alert_) {
189 if (!this->is_standard_alert_) {
190 // This means the alert is from onbeforeunload, and we need to
191 // strip off everything up to and including the first CR-LF pair.
192 size_t first_crlf = alert_text.find("\r\n\r\n");
193 if (first_crlf != std::string::npos && first_crlf + 4 < alert_text.size()) {
194 alert_text_value = alert_text.substr(first_crlf + 4);
195 }
196 } else {
197 alert_text_value = alert_text;
198 }
199 }
200 }
201 return alert_text_value;
202}
203
204std::string Alert::GetStandardDialogText() {
205 LOG(TRACE) << "Entering Alert::GetStandardDialogText";

Callers 2

HandleUnexpectedAlertMethod · 0.80
ExecuteInternalMethod · 0.80

Calls 5

GetStandardDialogTextMethod · 0.95
GetDirectUIDialogTextMethod · 0.95
findMethod · 0.80
LOGClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected