diff --git a/common/src/web/postForm.html b/common/src/web/postForm.html
new file mode 100644
index 0000000000000..2b2348e99ba48
--- /dev/null
+++ b/common/src/web/postForm.html
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
diff --git a/java/client/src/org/openqa/selenium/devtools/BUCK b/java/client/src/org/openqa/selenium/devtools/BUCK
index 209b32953b6a8..ad2e692e4356e 100644
--- a/java/client/src/org/openqa/selenium/devtools/BUCK
+++ b/java/client/src/org/openqa/selenium/devtools/BUCK
@@ -1,6 +1,6 @@
java_library(
name = "devtools",
- srcs = glob(["*.java"]),
+ srcs = glob(["**/*.java"]),
deps = [
"//java/client/src/org/openqa/selenium:selenium",
"//java/client/src/org/openqa/selenium/json:json",
@@ -9,5 +9,6 @@ java_library(
],
visibility = [
"//java/client/src/org/openqa/selenium/remote:",
+ "//java/client/test/...",
],
-)
\ No newline at end of file
+)
diff --git a/java/client/src/org/openqa/selenium/devtools/BUILD.bazel b/java/client/src/org/openqa/selenium/devtools/BUILD.bazel
index ecdf9f826c62e..9c5390eeef90e 100644
--- a/java/client/src/org/openqa/selenium/devtools/BUILD.bazel
+++ b/java/client/src/org/openqa/selenium/devtools/BUILD.bazel
@@ -1,6 +1,6 @@
java_library(
name = "devtools",
- srcs = glob(["*.java"]),
+ srcs = glob(["**/*.java"]),
visibility = [
"//java/client/src/org/openqa/selenium/chrome:__pkg__",
"//java/client/src/org/openqa/selenium/remote:__pkg__",
diff --git a/java/client/src/org/openqa/selenium/devtools/Command.java b/java/client/src/org/openqa/selenium/devtools/Command.java
index 3821be4305e97..3226495d3a6eb 100644
--- a/java/client/src/org/openqa/selenium/devtools/Command.java
+++ b/java/client/src/org/openqa/selenium/devtools/Command.java
@@ -24,7 +24,6 @@
import java.lang.reflect.Type;
import java.util.Map;
import java.util.Objects;
-import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Function;
public class Command {
diff --git a/java/client/src/org/openqa/selenium/devtools/Runtime.java b/java/client/src/org/openqa/selenium/devtools/Runtime.java
index 93ad5df0fe126..8770fb7d06614 100644
--- a/java/client/src/org/openqa/selenium/devtools/Runtime.java
+++ b/java/client/src/org/openqa/selenium/devtools/Runtime.java
@@ -60,6 +60,10 @@ private static Timestamp fromJson(long timestamp) {
return new Timestamp(timestamp);
}
+ public static Timestamp fromJson(Number timestamp) {
+ return fromJson(timestamp.longValue());
+ }
+
private long toJson() {
return epochMillis;
}
diff --git a/java/client/src/org/openqa/selenium/devtools/network/Network.java b/java/client/src/org/openqa/selenium/devtools/network/Network.java
new file mode 100644
index 0000000000000..b203a92e6084f
--- /dev/null
+++ b/java/client/src/org/openqa/selenium/devtools/network/Network.java
@@ -0,0 +1,611 @@
+// Licensed to the Software Freedom Conservancy (SFC) under one
+// or more contributor license agreements. See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership. The SFC licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License. You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied. See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+package org.openqa.selenium.devtools.network;
+
+import static org.openqa.selenium.devtools.ConverterFunctions.map;
+
+import com.google.common.collect.ImmutableMap;
+import com.google.common.reflect.TypeToken;
+
+import org.openqa.selenium.Beta;
+import org.openqa.selenium.devtools.Command;
+import org.openqa.selenium.devtools.Event;
+import org.openqa.selenium.devtools.network.model.AuthChallengeResponse;
+import org.openqa.selenium.devtools.network.model.ConnectionType;
+import org.openqa.selenium.devtools.network.model.Cookie;
+import org.openqa.selenium.devtools.network.model.Cookies;
+import org.openqa.selenium.devtools.network.model.DataReceived;
+import org.openqa.selenium.devtools.network.model.ErrorReason;
+import org.openqa.selenium.devtools.network.model.EventSourceMessageReceived;
+import org.openqa.selenium.devtools.network.model.InterceptionId;
+import org.openqa.selenium.devtools.network.model.LoadingFailed;
+import org.openqa.selenium.devtools.network.model.LoadingFinished;
+import org.openqa.selenium.devtools.network.model.RequestId;
+import org.openqa.selenium.devtools.network.model.RequestIntercepted;
+import org.openqa.selenium.devtools.network.model.RequestPattern;
+import org.openqa.selenium.devtools.network.model.RequestWillBeSent;
+import org.openqa.selenium.devtools.network.model.ResourceChangedPriority;
+import org.openqa.selenium.devtools.network.model.ResponseBody;
+import org.openqa.selenium.devtools.network.model.ResponseReceived;
+import org.openqa.selenium.devtools.network.model.SearchMatch;
+import org.openqa.selenium.devtools.network.model.SignedExchangeReceived;
+import org.openqa.selenium.devtools.network.model.WebSocketClosed;
+import org.openqa.selenium.devtools.network.model.WebSocketCreated;
+import org.openqa.selenium.devtools.network.model.WebSocketFrame;
+import org.openqa.selenium.devtools.network.model.WebSocketFrameError;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.Optional;
+
+/**
+ * All available DevTools Network methods and events
+ */
+@SuppressWarnings("OptionalUsedAsFieldOrParameterType")
+public class Network {
+
+ private final static String DOMAIN_NAME = "Network";
+
+ public static Command clearBrowserCache() {
+ return new Command<>(DOMAIN_NAME + ".clearBrowserCache", ImmutableMap.of());
+ }
+
+ public static Command clearBrowserCookies() {
+ return new Command<>(DOMAIN_NAME + ".clearBrowserCookies", ImmutableMap.of());
+ }
+
+ /**
+ * Response to Network.requestIntercepted which either modifies the request to continue with any modifications, or blocks it, or completes it with the provided response bytes.
+ * If a network fetch occurs as a result which encounters a redirect an additional Network.requestIntercepted event will be sent with the same InterceptionId.
+ * (EXPERIMENTAL)
+ *
+ * @param interceptionId - Identifier for the intercepted request
+ * @param errorReason (Optional) - If set this causes the request to fail with the given reason.
+ * Passing Aborted for requests marked with isNavigationRequest also cancels the navigation. Must not be set in response to an authChallenge
+ * @param rawResponse (Optional) - If set the requests completes using with the provided base64 encoded raw response, including HTTP status line and headers etc...
+ * Must not be set in response to an authChallenge
+ * @param url (Optional) - If set the request url will be modified in a way that's not observable by page. Must not be set in response to an authChallenge
+ * @param method (Optional) - If set this allows the request method to be overridden. Must not be set in response to an authChallenge
+ * @param postData (Optional) - If set this allows postData to be set. Must not be set in response to an authChallenge
+ * @param headers (Optional) - If set this allows the request headers to be changed. Must not be set in response to an authChallenge
+ * @param authChallengeResponse (Optional) - Response to a requestIntercepted with an authChallenge. Must not be set otherwise
+ * @return DevTools Command
+ */
+ @Beta
+ public static Command continueInterceptedRequest(InterceptionId interceptionId,
+ Optional errorReason,
+ Optional rawResponse,
+ Optional url,
+ Optional method,
+ Optional postData,
+ Optional