Stop the loading time in a mobile web page with appium


We have an automated test in Java, but the page I’m testing takes too much loading . Sometimes it can take at least 60 seconds. we need to detect this time and stop the page loading (The page only loads unnecessary things after 30 seconds) and continue with the process (Selenium wait until the page is completely load to continue with ne next step).

we tried to use a Thread, but it didn’t work, and we don’t understand why

driver.manage().timeouts().pageLoadTimeout(60000, TimeUnit.MILLISECONDS);
Thread jsInjector = new Thread(){
        public void run() {
            try {
                JavascriptExecutor jsi = (JavascriptExecutor) dr;
                System.out.println("#### Stop loading page #####");
            } catch (InterruptedException e) {



if you insist that Selenium waits page to load this = driver.get(url) will NOT end until page loaded.