Class BrowserResponseMessage
This class represents a web page response that is obtained and interacted with through a browser, such as Chromium, Firefox, or WebKit. It leverages the HttpResponseMessage class to store the HTTP response message, including the status code, headers, and content, and utilizes the Page class for page interactions.
public sealed class BrowserResponseMessage : IDisposable, IAsyncDisposable
- Inheritance
-
BrowserResponseMessage
- Implements
- Inherited Members
Remarks
The BrowserResponseMessage takes ownership of the browser and browser's page and its context. It ensures that all associated resources are properly released when the BrowserResponseMessage instance is disposed. This management of resources allows for the safe and efficient handling of the browser's lifecycle within the scope of the BrowserResponseMessage's usage. The actual results are then transferred to the TestSession objects into its PropertyBag, maintaining the integrity and state of the session throughout the test lifecycle.
Constructors
BrowserResponseMessage(IBrowser, IBrowserContext, IPage, HttpResponseMessage)
Initializes new instance of the BrowserResponseMessage object.
public BrowserResponseMessage(IBrowser browser, IBrowserContext context, IPage page, HttpResponseMessage responseMessage)
Parameters
browser
IBrowserA IBrowser object.
context
IBrowserContextA IBrowserContext object.
page
IPageA IPage object.
responseMessage
HttpResponseMessageAn HttpResponseMessage object for the BrowserResponseMessage.
Properties
HttpResponseMessage
A read-only property that gets the HttpResponseMessage object that is associated with the page.
public HttpResponseMessage HttpResponseMessage { get; }
Property Value
Page
A read-only property that gets the browser's page.
public IPage Page { get; }
Property Value
- IPage
Methods
Dispose()
Releases the resources used by the browser client.
public void Dispose()
DisposeAsync()
Asynchronously releases the resources used by the browser client.
public ValueTask DisposeAsync()
Returns
- ValueTask
A task that represents the asynchronous dispose operation.