0 votes
1 view
in DevOps and Agile by (19.8k points)

We've been using selenium with great success to handle high-level website testing (in addition to extensive python doctests at a module level). However now we're using extjs for a lot of pages and its proving difficult to incorporate Selenium tests for the complex components like grids.

Has anyone had success writing automated tests for extjs-based web pages? Lots of googling finds people with similar problems, but few answers. Thanks!

1 Answer

0 votes
by (63.4k points)

We are developing a testing framework that uses selenium and encountered problems with ExtJS (since it's client-side rendering). I find it useful to look for an element once the DOM is ready.

public static boolean waitUntilDOMIsReady(WebDriver driver) {

    def maxSeconds = DEFAULT_WAIT_SECONDS * 10

    for (count in 1..maxSeconds) {

        Thread.sleep(100)

        def ready = isDOMReady(driver);

        if (ready) {

            break;

        }

    }

}

public static boolean isDOMReady(WebDriver driver){

    return driver.executeScript("return document.readyState");

}

Try this code, it may help you! 

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...