diff --git a/java/src/org/openqa/selenium/HasDownloads.java b/java/src/org/openqa/selenium/HasDownloads.java index d759f279cc349..2d65a35f48b77 100644 --- a/java/src/org/openqa/selenium/HasDownloads.java +++ b/java/src/org/openqa/selenium/HasDownloads.java @@ -33,7 +33,7 @@ public interface HasDownloads { * @throws WebDriverException if capability to enable downloads is not set */ default void requireDownloadsEnabled(Capabilities capabilities) { - boolean downloadsEnabled = (boolean) capabilities.getCapability("se:downloadsEnabled"); + boolean downloadsEnabled = capabilities.is("se:downloadsEnabled"); if (!downloadsEnabled) { throw new WebDriverException( "You must enable downloads in order to work with downloadable files.");