Add function to get browser url for Playwright
This commit is contained in:
parent
a846ec405f
commit
d30c17365b
|
|
@ -30,4 +30,5 @@ public interface IWebBrowser
|
|||
Task<BrowserActionResult> SendHttpRequest(MessageInfo message, HttpRequestParams actionParams);
|
||||
Task<BrowserActionResult> GetAttributeValue(MessageInfo message, ElementLocatingArgs location);
|
||||
Task<BrowserActionResult> SetAttributeValue(MessageInfo message, ElementLocatingArgs location);
|
||||
Task<string> GetCurrentUrl(MessageInfo message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,4 +17,12 @@ public partial class PlaywrightWebDriver
|
|||
|
||||
return answer;
|
||||
}
|
||||
public async Task<string> GetCurrentUrl(MessageInfo message)
|
||||
{
|
||||
var page = _instance.GetPage(message.ContextId);
|
||||
if (page == null)
|
||||
return string.Empty;
|
||||
return page.Url;
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue