Skip to content

Commit f0ee284

Browse files
authored
Compatibility with jenkinsci/jenkins#7203 (#186)
1 parent 514811d commit f0ee284

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/test/java/hudson/plugins/throttleconcurrents/ThrottleQueueTaskDispatcherTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
5151
*/
5252
public class ThrottleQueueTaskDispatcherTest {
53-
private static final String buttonsXPath = "//button[@tabindex='0']";
53+
private static final String buttonsXPath = "//button";
5454
private static final String configFormName = "config";
5555
private static final String configUrlSuffix = "configure";
5656
private static final String logUrlPrefix = "log/";
@@ -341,12 +341,15 @@ private HtmlPage submitForm(HtmlForm form) throws IOException {
341341
)
342342
.click();
343343

344-
} else {
344+
} else if (Jenkins.getVersion().isOlderThan(new VersionNumber("2.376"))) {
345345
List<HtmlElement> elementsByAttribute = form.getElementsByAttribute("input", "type", "submit");
346346
if (elementsByAttribute.isEmpty()) {
347347
fail("Failed to find an input with type submit on the page");
348348
}
349349
page = elementsByAttribute.get(0).click();
350+
} else {
351+
HtmlButton button = form.getButtonByName("Submit");
352+
page = button.click();
350353
}
351354
return page;
352355
}

0 commit comments

Comments
 (0)