Index: ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/tools/JSWaiter.java =================================================================== diff -u -r21681 -r21682 --- ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/tools/JSWaiter.java (.../JSWaiter.java) (revision 21681) +++ ssts-web/src/test/java/test/forgon/disinfectsystem/selenium/tools/JSWaiter.java (.../JSWaiter.java) (revision 21682) @@ -36,7 +36,8 @@ .withTimeout(20000, TimeUnit.MILLISECONDS) .pollingEvery(250, TimeUnit.MILLISECONDS) .ignoring(JavascriptException.class) - .ignoring(NoSuchWindowException.class); + .ignoring(NoSuchWindowException.class) + .ignoring(ClassCastException.class); jsExec = (JavascriptExecutor) jsWaitDriver; } @@ -49,18 +50,14 @@ // Get JQuery is Ready boolean jqueryReady = false; - // 捕获JavascriptException异常 + // 捕获Exception异常 try { jqueryReady = (Boolean) jsExec .executeScript("return jQuery.active==0"); - } catch (JavascriptException e) { + } catch (Exception e) { e.printStackTrace(); logger.debug(e.getMessage()); } - catch (NoSuchWindowException e) { - logger.debug("错误信息:" + e.getMessage()); - e.printStackTrace(); - } // Wait JQuery until it is Ready! if (!jqueryReady) { logger.debug("JQuery is NOT Ready!"); @@ -104,7 +101,8 @@ .withTimeout(25000, TimeUnit.MILLISECONDS) .pollingEvery(250, TimeUnit.MILLISECONDS) .ignoring(JavascriptException.class) - .ignoring(NoSuchWindowException.class); + .ignoring(NoSuchWindowException.class) + .ignoring(ClassCastException.class); JavascriptExecutor jsExec = (JavascriptExecutor) jsWaitDriver; @@ -125,15 +123,11 @@ .executeScript(waitPageReadyJS).toString() .equals("complete"); } - // 捕获JavascriptException,忽略该异常 - catch (JavascriptException e) { + // 捕获Exception,忽略该异常 + catch (Exception e) { logger.debug("错误信息:" + e.getMessage()); e.printStackTrace(); } - catch (NoSuchWindowException e) { - logger.debug("错误信息:" + e.getMessage()); - e.printStackTrace(); - } // Wait Javascript until it is Ready! if (!jsReady) { logger.debug("JS is NOT Ready!"); @@ -158,14 +152,10 @@ try { jQueryDefined = (Boolean) jsExec .executeScript("return typeof jQuery != 'undefined'"); - } catch (JavascriptException e) { + } catch (Exception e) { logger.debug("错误信息:" + e.getMessage()); e.printStackTrace(); } - catch (NoSuchWindowException e) { - logger.debug("错误信息:" + e.getMessage()); - e.printStackTrace(); - } for (int i = 0; i < 3; i++) { if (jQueryDefined == true) { // Pre Wait for stability (Optional)