Page Object Model – Selenium FrameWork

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

Advertisements

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.

Continue reading

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;

Continue reading

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.

Continue reading

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.

Continue reading