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

Method GetBrowserUrl

cpp/iedriver/Browser.cpp:299–312  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

297}
298
299std::string Browser::GetBrowserUrl() {
300 LOG(TRACE) << "Entering Browser::GetBrowserUrl";
301
302 CComBSTR url;
303 HRESULT hr = this->browser_->get_LocationURL(&url);
304 if (FAILED(hr)) {
305 LOGHR(WARN, hr) << "Unable to get current URL, call to IWebBrowser2::get_LocationURL failed";
306 return "";
307 }
308
309 std::wstring converted_url = url;
310 std::string current_url = StringUtilities::ToString(converted_url);
311 return current_url;
312}
313
314HWND Browser::GetContentWindowHandle() {
315 LOG(TRACE) << "Entering Browser::GetContentWindowHandle";

Callers 2

GetCurrentUrlMethod · 0.45
ExecuteInternalMethod · 0.45

Calls 1

LOGClass · 0.50

Tested by

no test coverage detected