Last active
December 24, 2015 08:59
-
-
Save huguogang/6774584 to your computer and use it in GitHub Desktop.
Java code to inject javascript and check for ExtJS Ajax error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//make sure it's run after every page load | |
public static void injectSJTXE(WebDriver driver) throws IOException { | |
URL url; | |
String js; | |
url = Resources.getResource(ExtJSUtil.class, "SJTXE.js"); | |
js = Resources.toString(url, Charsets.UTF_8); | |
((JavascriptExecutor) driver).executeScript(js); | |
} | |
//code to check if there are ExtJS Ajax error | |
Boolean hasAjaxFailure = (Boolean) ((JavascriptExecutor) driver).executeScript("return SJTXE.hasAjaxFailure();"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment