Selenium

  • 25
    Jul

    Integrating POM, POJO for Test driven automated test scenarios

    In earlier post, POM framework was identified which segregates verification and page objects identification under different classes (Page and workflow classes). With this approach, data is still manually entered...

    Read More
  • 25
    Jul

    Page Object Model – framework to organize page elements and actions on page objects

    One can always interact with page objects using Selenium webdriver something like this: public class myFirstWebDriver() { @Test public void validate_login_page() { WebDriver wd = new FirefoxDriver(); wd.manage().timeouts().implicitlywait(10, TimeUnit.SECONDS);...

    Read More
  • 18
    Jul

    Log automation run results

    In order to collect information detailing timestamp of execution and steps performed during Automation execution, logging the steps is critical and can serve as a basis for tracking it...

    Read More
  • 17
    Jul

    Creating a datadriven tests with TestNG

    Following function can be used to create a data driven tests using “Dataprovider” annotation of TestNG import java.util.HashMap; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.testng.annotations.DataProvider; import...

    Read More
  • 17
    Jul

    Read the excel data as HashMap>

    Following code snippet can be used to read an entire Excel file as HashMap import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import...

    Read More
  • 12
    Jul

    Convert a String to Date type with LocalDate

    // converting a String in dd-mmm-yyyy format (e.g. 06-Sep-2018) to dd-MMM-yyyy format String dateString = “21-Aug-1979”; LocalDate parsed = DateTimeFormatter.ofPattern(“dd-MMM-yyyy”).parse(dateString); // from java.time.LocalDate into java.lang.String LocalDate localDate = LocalDate.now();...

    Read More
  • 12
    Jul

    Extracting images from a PDF File – org.apache.pdfbox

    Maven dependency configuration org.apache.pdfbox pdfbox 2.0.8 This application extracts images from a PDF document. We loop over each page and get all the resources. Next we iterate over each...

    Read More
  • 09
    Jul

    Get CssValue / Attribute of an WebElement in selenium

    Sometimes it is necessary to get the Attribute / run time value of Css property of a WebElement. We can use following code-snippet to get run time value of...

    Read More
  • 06
    Jul

    Defining data for POM pages elements

    Rules for POJO in java 1. Class needs to be Public 2. Properties are Private 3. Every property should have public getter and setters 4. Public default constructor Mandatory...

    Read More
  • 06
    Jul

    Creating a global context for your automation run

    Many a time we see scripts have to refer many global variable and modify per script execution requirements. Following code snippet allows an end user to define global variables...

    Read More