This will give you an introduction to “Page Object Model” and its implementation in Selenium using java. Before starting with Page Object Model let’s first know what are design patterns. Design patterns. A Design pattern is a generic solution to a common software design/architecture problem. Implementation of these design patterns leads to inclusion of best practices and best solution, evolved over the time by others while working with similar problems. Page Object Model in Selenium A Page Object Model is a design pattern that can be implemented using selenium webdriver. It essentially models the pages/screen of the application as objects called Page Objects, all the functions that can be performed in the specific page are encapsulated in the page object of that screen. In this way any change made in the UI will only affect that screens page object class thus abstracting the changes from the test classes. Advantages of using Page Object Model Increases code reusability – code to work with events of a page is written only once and used in different test cases Improves code maintainability – any UI change leads to updating the code in page object classes only leaving the test classes unaffected Continue reading
Page object model
Password encoder for Selenium Webdriver
By using this Password encoder, we can secure the password.Its so simple to Encrypt.
How to Extract Cookies in a Page
This post helps you,How to extract Cookies in a page.We can Add/Delete Cookies by using few methods.
import java.util.Set;
import java.util.concurrent.TimeUnit;
How To Find Broken Links
There always a problem to find the broken links/Images present in the application.This post helps you to find the Broken links.And it captures all the valid links and invalid links in an Excel Sheet
Here i am using java.net.HttpURLConnection.This can be done in many ways too,This code can be used for any project though.
How To Read Data From NotePad Using Webdriver
This post helps you to Read Data from Notepad.This is so simple.By using two classes FileReader,BufferedReader we can read data.
How To Write Data in NotePad Using Selenium
Sometimes we have to print some data into Notepad according to our need.So this post helps you to write data into Notepad.
How To Read Data From Excel
In case of DataDriven Concept,We have to Read Data from Excel sheets.This post helps you to Read Data from Excel files.
This is the Sample Test Data . Please improvise.
Click Here to Download TestData
import java.io.File;
import java.io.FileInputStream;
How To Handle Alerts Using Selenium WebDriver
There’s always a difficulty to handle Alerts in a Page.In that case we’ve to create a Method to handle alert and use Try and catch block.So that whenever an alert appears,it will handle.
Database Testing Using Selenium
Generally We don’t have to Test entire database of our application.To my knowledge, We use Selenium to test the Database whether data given in the front end(UI) is as same as the data present in the Database(Back End).
Note: We don’t do negative testing in database.
Here i am using MySql to test the database.
You need to Download Java.sql jar and configure database in your system. I’ll explain database configuration in Upcoming posts.
How To Create Data into Excel using WebDriver
There will be a need to write data into Excel.So This post tells you How to Write data into Excel.
Download Jxl jar/Apache Poi. Here I am Using Jxl jar.