Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k 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 (62.9k 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! 

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...