Extension Method in Selenium, what, why, and how???

An Extension Method enable us to add methods to existing   types without creating a new derived type, recompile, or modify the original types. Alright, confusing??? Now consider you don’t have access for Car class and if I ask you to add a method for Car class, how would you do that? In this kind … Continue reading Extension Method in Selenium, what, why, and how???

How to include screenshots in ReportNG report?

Any test automation report is incomplete without the screenshots and including them in ReportNG is not that much difficult. In today’s post we will see how we can include the screenshots in ReportNG report. If you are wondering how to configure ReportNg with selenium then you can refer my previous post. Here I am again … Continue reading How to include screenshots in ReportNG report?

How to configure ReportNG with Selenium WebDriver?

Selenium WebDriver is open source test automation framework which does not come with reporting facility. So selenium user has to be depended upon the third party plug-ins. ReportNG is a simple HTML reporting plug-in for the TestNG unit-testing framework. It is intended as a replacement for the default TestNG HTML report. There are very few … Continue reading How to configure ReportNG with Selenium WebDriver?

How to configure Properties file with Selenium WebDriver?

Why Properties file? To hide sensitive information of the projects we save the information in properties file. To configure Properties file, create a new file and save as with .properties extension. Now add the data in following manner in Properties file: URL=http://www.google.com INT_USR=msrivastava INT_PWD=Hello123& Now use below lines of code to read this property file- try{ … Continue reading How to configure Properties file with Selenium WebDriver?

How to configure Selenium Grid?

Here I noted down some quick steps to configure Selenium Grid on windows. I am assuming that you are aware about selenium and its features. So here we go- Download Selenium Standalone Jar file from here. Dump it somewhere in host and node machines. Open CMD at Host machine and go to location where you … Continue reading How to configure Selenium Grid?

How to run Selenium + TestNG script from Command Line?

This is an alternate way to execute our selenium script from command prompt. Here, I am considering few points- Your project is already set-up in Eclipse Project already has testng.xml file. All selenium and other third party jar files are located under project home folder (lib folder). You are able to execute your script by … Continue reading How to run Selenium + TestNG script from Command Line?

EventFiringWebDriver, WebDriverEventListener, and AbstarctWebDriverEventListener

Before getting into the sample code, lets have a look on EventFiringWebDriver, WebDriverEventListener, and AbstarctWebDriverEventListener descriptions. EventFiringWebDriver is a class and wrapper around an arbitrary webdriver instance which supports registering of a WebDriverEventListener. WebDriverEventListener is interface which includes list of abstract events methods and all should be implemented if we are implementing it. AbstarctWebDriverEventListener is abstract class which … Continue reading EventFiringWebDriver, WebDriverEventListener, and AbstarctWebDriverEventListener

Logging with Log4J

Log4j is widely used API for generating the logs and there are few steps to configure it with Selenium Webdriver. Download the latest log4j api from here. Include the log4j-1.2.XX.jar file in your project build path. Right click on your project > New > Other…>XML>XML FIle> and create a XML file with the log4j.xml name. … Continue reading Logging with Log4J

Apache ANT Setup

Follow the below steps to set-up ANT build tool- Go to the folder which have been downloaded in this cases “C:\Selenium\ANT\apache-ant-1.8.4-bin\apache-ant-1.8.4” Go to Computer properties->Click on Advance tab->Environment Variables In the System Variable Create an new variable name as “ANT_HOME” Paste the above ANT directory in the path text box Click Search for a PATH variable … Continue reading Apache ANT Setup

Significance of alwaysRun=true @Test annotation property.

alwaysRun=true property informs the system that TestNg should run the test method if depends on @Test method fails also. Basically it helps to achieve the soft dependency, the feature of TestNG which helps to execute the testng test methods in order. Below is the code example: So above code states that system will execute the … Continue reading Significance of alwaysRun=true @Test annotation property.