Kostya Marchenko committed 61b40ae

Added exception when trying to use multiple injections with HtmlUnit driver as it's not supported yet.

Comments (0)

Files changed (1)


      * @throws Exception if script can not be injected
     public static void injectJavaScripts(WebDriver driver, ArrayList<String> javaScripts) throws Exception {
+        //Html Unit not supported yet for multiple injections
+        if (driver instanceof HtmlUnitDriver) {
+            throw new UnsupportedOperationException("Can't inject multiple JavaScripts when using HtmlUnit driver");
+        }
         for (String javaScript : javaScripts) {
             injectJavaScript(driver, javaScript);