Ghost Browser/Invisible Browser:
package gmr;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
public class GhostBrowser{
WebDriver driver;
@Test()
public void test() throws InterruptedException{
/*
* Opening Browser
*/
driver=new HtmlUnitDriver();
/*
* Maximize the window
*/
driver.manage().window().maximize();
/*
* Open Gmail Login Page
*/
driver.get("http://www.gmr-automation.blogspot.in/");
Thread.sleep(1000);
System.out.println("title " +driver.getTitle());
Thread.sleep(1000);
/*
* browser closing and driver closing.
*/
driver.close();
driver.quit();
}
}
- We know already some popular browser already.But here some interesting fact about the invisible browser.
- There is no UI for this browser(browser window)
- This is also called as headless browser ,but its has brain just for fun..
- without opening Browser the scripts will run.
- Its will run more fast rather than traditional browser
- Its mainly used in regression testing
- smoke and sanity testing it will be used
package gmr;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
public class GhostBrowser{
WebDriver driver;
@Test()
public void test() throws InterruptedException{
/*
* Opening Browser
*/
driver=new HtmlUnitDriver();
/*
* Maximize the window
*/
driver.manage().window().maximize();
/*
* Open Gmail Login Page
*/
driver.get("http://www.gmr-automation.blogspot.in/");
Thread.sleep(1000);
System.out.println("title " +driver.getTitle());
Thread.sleep(1000);
/*
* browser closing and driver closing.
*/
driver.close();
driver.quit();
}
}