Interview Questions

Selenium WebDriver - Open a browser in memory means whenever it will try to open a browser the browser page must not come and can perform the operation internally.

Selenium WebDriver Interview question and Answers


(Continued from previous question...)

Selenium WebDriver - Open a browser in memory means whenever it will try to open a browser the browser page must not come and can perform the operation internally.

use HtmlUnitDriver.
ex-
public class Memory { public static void main(String[] args) { HtmlUnitDriver driver = new HtmlUnitDriver(true); driver.setJavascriptEnabled(false);

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

driver.get("https://www.google.co.in/"); System.out.println(driver.getTitle());
} }


public class Memory {
public static void main(String[] args) {
HtmlUnitDriver driver = new HtmlUnitDriver(true);
driver.setJavascriptEnabled(false);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get("https://www.google.co.in/");
System.out.println(driver.getTitle());
}

}

(Continued on next question...)

Other Interview Questions