Avoid Page Loading And Run the Tests In Selenium Webdriver


Its so sick us to wait till the page loads while automating the app.So to avoid it this post helps you out.

How to avoid full page load | Webdriver

FirefoxProfile fp = new FirefoxProfile();
fp.setPreference(“webdriver.load.strategy”, “unstable”);
driver = new FirefoxDriver(fp);
baseUrl = “http://xyz.com”;
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);

driver.navigate().to(“http://xyz.com”);
driver.findElement(By.xpath(Value)).click();
System.out.println(“Button got clicked”);

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s