@@ -70,6 +70,7 @@ public class FirefoxDriver : RemoteWebDriver
70
70
private const string SetContextCommand = "setContext" ;
71
71
private const string InstallAddOnCommand = "installAddOn" ;
72
72
private const string UninstallAddOnCommand = "uninstallAddOn" ;
73
+ private const string GetFullPageScreenshotCommand = "fullPageScreenshot" ;
73
74
74
75
/// <summary>
75
76
/// Initializes a new instance of the <see cref="FirefoxDriver"/> class.
@@ -153,6 +154,7 @@ public FirefoxDriver(FirefoxDriverService service, FirefoxOptions options, TimeS
153
154
this . AddCustomFirefoxCommand ( SetContextCommand , CommandInfo . PostCommand , "/session/{sessionId}/moz/context" ) ;
154
155
this . AddCustomFirefoxCommand ( InstallAddOnCommand , CommandInfo . PostCommand , "/session/{sessionId}/moz/addon/install" ) ;
155
156
this . AddCustomFirefoxCommand ( UninstallAddOnCommand , CommandInfo . PostCommand , "/session/{sessionId}/moz/addon/uninstall" ) ;
157
+ this . AddCustomFirefoxCommand ( GetFullPageScreenshotCommand , CommandInfo . GetCommand , "/session/{sessionId}/moz/screenshot/full" ) ;
156
158
}
157
159
158
160
/// <summary>
@@ -242,6 +244,17 @@ public void UninstallAddOn(string addOnId)
242
244
this . Execute ( UninstallAddOnCommand , parameters ) ;
243
245
}
244
246
247
+ /// <summary>
248
+ /// Gets a <see cref="Screenshot"/> object representing the image of the full page on the screen.
249
+ /// </summary>
250
+ /// <returns>A <see cref="Screenshot"/> object containing the image.</returns>
251
+ public Screenshot GetFullPageScreenshot ( )
252
+ {
253
+ Response screenshotResponse = this . Execute ( GetFullPageScreenshotCommand , null ) ;
254
+ string base64 = screenshotResponse . Value . ToString ( ) ;
255
+ return new Screenshot ( base64 ) ;
256
+ }
257
+
245
258
/// <summary>
246
259
/// In derived classes, the <see cref="PrepareEnvironment"/> method prepares the environment for test execution.
247
260
/// </summary>
0 commit comments