Skip to content

Commit ce2087f

Browse files
committed
[java] add name of what is being executed to large JS executions
1 parent bfea707 commit ce2087f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

java/src/org/openqa/selenium/remote/codec/w3c/W3CHttpCommandCodec.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ public W3CHttpCommandCodec() {
308308

309309
case SUBMIT_ELEMENT:
310310
return toScript(
311-
"var form = arguments[0];\n" +
311+
"/* submitForm */var form = arguments[0];\n" +
312312
"while (form.nodeName != \"FORM\" && form.parentNode) {\n" +
313313
" form = form.parentNode;\n" +
314314
"}\n" +
@@ -341,9 +341,9 @@ private List<String> stringToUtf8Array(String toConvert) {
341341
URL url = getClass().getResource(scriptName);
342342

343343
String rawFunction = Resources.toString(url, StandardCharsets.UTF_8);
344+
String atomName = atomFileName.replace(".js", "");
344345
String script = String.format(
345-
"return (%s).apply(null, arguments);",
346-
rawFunction);
346+
"/* %s */return (%s).apply(null, arguments);", atomName, rawFunction);
347347
return toScript(script, args);
348348
} catch (IOException | NullPointerException e) {
349349
throw new WebDriverException(e);

java/src/org/openqa/selenium/support/locators/RelativeLocatorScript.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class RelativeLocatorScript {
3838
URL url = RelativeLocator.class.getResource(location);
3939

4040
String rawFunction = Resources.toString(url, StandardCharsets.UTF_8);
41-
FIND_ELEMENTS = String.format("return (%s).apply(null, arguments);", rawFunction);
41+
FIND_ELEMENTS = String.format("/* findElements */return (%s).apply(null, arguments);", rawFunction);
4242
} catch (IOException e) {
4343
throw new UncheckedIOException(e);
4444
}

0 commit comments

Comments
 (0)