According to WebDriver docs, when Page Loading takes lot of time, then you need to stop downloading additional subresources like (images, css, js etc) and you can modify the pageLoadStrategy through WebDriver.
As of now, pageLoadStrategy supports the following values:
normal:-
This will make Selenium wait till the entire page is loaded. (html content and subresources downloaded and parsed).
eager:-
This will make Selenium wait for DOMContentLoaded event (html content downloaded and parsed only).
none:-
This will make Selenium to return immediately after the initial page content is completely received (html content downloaded).
By default, when Selenium loads a page, it follows the normal pageLoadStrategy. You can implement it using DesiredCapabilities() with firefox or ChromeOptions() for chrome. Usage is below.
DesiredCapabilities-
System.setProperty("webdriver.gecko.driver", "C:\\Utility\\BrowserDrivers\\geckodriver.exe");
DesiredCapabilities dcap = new DesiredCapabilities();
dcap.setCapability("pageLoadStrategy", "normal");
FirefoxOptions opt = new FirefoxOptions();
opt.merge(dcap);
WebDriver driver = new FirefoxDriver(opt);
driver.get("https://www.google.com/");
System.out.println(driver.getTitle());
driver.quit();
ChromeOptions-
System.setProperty("webdriver.gecko.driver", "C:\\Utility\\BrowserDrivers\\geckodriver.exe");
FirefoxOptions opt = new FirefoxOptions();
opt.setPageLoadStrategy(PageLoadStrategy.NORMAL);
WebDriver driver = new FirefoxDriver(opt);
driver.get("https://www.google.com/");
System.out.println(driver.getTitle());
driver.quit();