File tree Expand file tree Collapse file tree
java/client/src/org/openqa/selenium Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,6 @@ java_export(
1616 deps = [
1717 "//java:auto-service" ,
1818 "//java/client/src/org/openqa/selenium/devtools" ,
19- "//java/client/src/org/openqa/selenium/devtools/noop" ,
2019 "//java/client/src/org/openqa/selenium/json" ,
2120 "//java/client/src/org/openqa/selenium/remote" ,
2221 artifact ("com.google.guava:guava" ),
Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ java_export(
3434 "*.java" ,
3535 "events/*.java" ,
3636 "idealized/**/*.java" ,
37+ "noop/*.java" ,
3738 ],
3839 exclude = PROTOTYPE_SOURCES + GENERATOR_SOURCES ,
3940 ),
Original file line number Diff line number Diff line change 1919
2020import com .google .auto .service .AutoService ;
2121import org .openqa .selenium .Capabilities ;
22+ import org .openqa .selenium .devtools .noop .NoOpCdpInfo ;
2223import org .openqa .selenium .remote .AugmenterProvider ;
2324import org .openqa .selenium .remote .ExecuteMethod ;
2425
@@ -41,7 +42,8 @@ public Class<HasDevTools> getDescribedInterface() {
4142
4243 @ Override
4344 public HasDevTools getImplementation (Capabilities caps , ExecuteMethod executeMethod ) {
44- Optional <DevTools > devTools = SeleniumCdpConnection .create (caps ).map (conn -> new DevTools (null , conn ));
45+ CdpInfo info = new CdpVersionFinder ().match (caps .getBrowserVersion ()).orElseGet (NoOpCdpInfo ::new );
46+ Optional <DevTools > devTools = SeleniumCdpConnection .create (caps ).map (conn -> new DevTools (info ::getDomains , conn ));
4547
4648 return () -> devTools .orElseThrow (() -> new IllegalStateException ("Unable to create connection to " + caps ));
4749 }
Load diff This file was deleted.
Original file line number Diff line number Diff line change 1717
1818package org .openqa .selenium .devtools .noop ;
1919
20+ import org .openqa .selenium .BuildInfo ;
2021import org .openqa .selenium .devtools .DevToolsException ;
2122import org .openqa .selenium .devtools .idealized .Domains ;
2223import org .openqa .selenium .devtools .idealized .Events ;
2728
2829public class NoOpDomains implements Domains {
2930
30- private final static String WARNING =
31+ private static BuildInfo INFO = new BuildInfo ();
32+
33+ private final static String WARNING = String .format (
3134 "You are using a no-op implementation of the CDP. The most likely reason" +
3235 " for this is that Selenium was unable to find an implementation of the " +
3336 "CDP protocol that matches your browser. Please be sure to include an " +
3437 "implementation on the classpath, possibly by adding a new (maven) " +
35- "dependency of `org.seleniumhq.selenium:selenium-devtools:NN` where " +
36- "`NN` matches the major version of the browser you're using." ;
38+ "dependency of `org.seleniumhq.selenium:selenium-devtools-vNN:%s` where " +
39+ "`NN` matches the major version of the browser you're using." ,
40+ INFO .getReleaseLabel ());
3741
3842 @ Override
3943 public Events <?> events () {
You can’t perform that action at this time.
0 commit comments