Skip to main content

Posts

Showing posts from May, 2018

Selenium Snippets (WebDriver)

How would we make sure that a page is loaded using Selenium WebDriver?                  import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import java.util.concurrent.TimeUnit; import org.openqa.selenium.JavascriptExecutor; import org.testng.AssertJUnit; import org.testng.annotations.Test; public class CheckPageLoad { static WebDriver driver; static String pageLoadingStatus = null; @Test     void TestCase1_HomePage_LoadingCheck(){ System.setProperty("webdriver.chrome.driver","Add your chromedriver.exe path here"); driver=new ChromeDriver();   driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.get("https://postbysanta.in"); JavascriptExecutor js; js = (JavascriptExecutor) driver; String pageLoadStatus = (Str...