File tree 4 files changed +20
-0
lines changed
java/client/src/org/openqa/selenium
4 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 17
17
18
18
package org .openqa .selenium .printoptions ;
19
19
20
+ import java .util .Map ;
21
+
20
22
public class PrintOptions {
21
23
22
24
public enum PrintOrientation {
@@ -89,4 +91,8 @@ public PageSize getPageSize() {
89
91
public PageMargin getPageMargin () {
90
92
return this .pageMargin ;
91
93
}
94
+
95
+ public Map <String , String > to_json () {
96
+ return null ;
97
+ }
92
98
}
Original file line number Diff line number Diff line change 25
25
import org .openqa .selenium .Point ;
26
26
import org .openqa .selenium .WindowType ;
27
27
import org .openqa .selenium .interactions .Sequence ;
28
+ import org .openqa .selenium .printoptions .PrintOptions ;
28
29
29
30
import java .time .Duration ;
30
31
import java .util .Collection ;
@@ -227,6 +228,11 @@ static CommandPayload SET_ALERT_VALUE(String keysToSend) {
227
228
228
229
String SET_TIMEOUT = "setTimeout" ;
229
230
231
+ String PRINT_PAGE = "printPage" ;
232
+ static CommandPayload PRINT_PAGE (PrintOptions options ) {
233
+ return new CommandPayload (PRINT_PAGE , options .to_json ());
234
+ }
235
+
230
236
@ Deprecated
231
237
static CommandPayload SET_IMPLICIT_WAIT_TIMEOUT (long time , TimeUnit unit ) {
232
238
return new CommandPayload (
Original file line number Diff line number Diff line change 77
77
import org .openqa .selenium .logging .LoggingPreferences ;
78
78
import org .openqa .selenium .logging .Logs ;
79
79
import org .openqa .selenium .logging .NeedsLocalLogs ;
80
+ import org .openqa .selenium .printoptions .PrintOptions ;
80
81
import org .openqa .selenium .remote .internal .WebElementToJsonConverter ;
81
82
import org .openqa .selenium .virtualauthenticator .Credential ;
82
83
import org .openqa .selenium .virtualauthenticator .HasVirtualAuthenticator ;
@@ -331,6 +332,11 @@ public WebElement findElement(By locator) {
331
332
}
332
333
}
333
334
335
+ public String printPage (PrintOptions options ) {
336
+ Response response = execute (DriverCommand .PRINT_PAGE (options ));
337
+
338
+ return (String ) response .getValue ();
339
+ }
334
340
@ Override
335
341
public List <WebElement > findElements (By locator ) {
336
342
if (locator instanceof By .StandardLocator ) {
Original file line number Diff line number Diff line change @@ -154,6 +154,8 @@ public W3CHttpCommandCodec() {
154
154
defineCommand (GET_ALERT_TEXT , get (alert + "/text" ));
155
155
defineCommand (SET_ALERT_VALUE , post (alert + "/text" ));
156
156
157
+ defineCommand (PRINT_PAGE , post (sessionId + "/print" ));
158
+
157
159
defineCommand (UPLOAD_FILE , post (sessionId + "/se/file" ));
158
160
159
161
defineCommand (GET_ACTIVE_ELEMENT , get (sessionId + "/element/active" ));
You can’t perform that action at this time.
0 commit comments