Posts

BDD POM.XML

<properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> </properties> <dependencies> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-java</artifactId> <version>1.2.5</version> <scope>test</scope> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-jvm</artifactId> <version>1.2.5</version> <type>pom</type> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-junit</artifactId> <version>1.2.5</version> <scope>test</scope> </dependency> <dependency> <groupId>info.cukes</groupId> <artifactId>cucumber-jvm-deps</artifactId> <version>1.0.5</version> </depen...

POM XML

Refer to below basic POM.xml,which contains basic dependencies for Page Object Model <properties> <suiteXmlFile>src/main/resources/testng.xml</suiteXmlFile> </properties> <dependencies> <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java --> <dependency>     <groupId>org.seleniumhq.selenium</groupId>     <artifactId>selenium-java</artifactId>     <version>3.9.1</version> </dependency> <dependency>   <groupId>org.testng</groupId>   <artifactId>testng</artifactId>   <version>6.8</version>   <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/com.cedarsoft.commons/io --> <dependency>     <groupId>com.cedarsoft.commons</groupId>     <artifactId>io</artifactId>     ...

Singular Driver Page Object Model

Page Object Model is the framework driven from TestNG framework where every individual Page (screen) is separated in JAVA class. As we all know in Page Object Model test cases are also separated as per screen basis. In this developed framework below mentioned points are considered: Individual screens are separated in each JAVA classes Common selenium methods are stored in separate JAVA class Test cases are also separated as per screen Configurable things are kept apart from non configurable things. For example, URL which can be changed as per env availability is taken care by using config.properties class. Where env key will decide which URL to hit. Cross browser testing is done by using simple config.properties file by specifying Browser key and reading it while launching the browser. TestNG framework is used to create Page Object Model framework Basic TestNG annotations are used Reporting is done via Extents reporting jar No method in classes are static, and Binding is co...

Why WebDriver driver?

As we proceed further to the webpage automation, the important questions arises in mind why always WebDriver driver = new ChromeDriver() / FireFoxdriver() ... and why not to use WebDriver driver = new WebDriver(), or ChromeDriver driver = new ChromeDriver(). 1. Since we can not create object of an Interface as it does not have any constructor, the possiblity WebDriver driver = new WebDriver() is not valid since WebDriver is an interface. 2. If we decided to use  ChromeDriver driver = new ChromeDriver() then our script will only capable of launching Chrome driver and we will not able to handle the multi browser. Since we can not create object of an interface, JAVA still allows to use abstract methods in it. How? The answer is the class which implements an interface will help up to create an object. As ChromeDriver()/ FireFoxDriver()/ IEdriver classes(s) implements Webdriver interface, it is possible to create object of WebDriver with reference of these classes. Hence , whi...

Automation World: How to launch Chrome browser in Selenium

Automation World: How to launch Chrome browser in Selenium : Since Selenium alone is not capable of launching the Chrome browser, we need to take help of third party executable driver which will laun...

Automation World: How to launch Internet Explorer using Selenium

Automation World: How to launch Internet Explorer using Selenium : While launching Internet Explorer using selenium is a tedious job since it involves much of internal security and restrictions. As we have...

Automation World: How to handle Drop Downs using Selenium

Automation World: How to handle Drop Downs using Selenium : Working with drop down options is very easy task when using selenium since we have already drafted method “Select” in selenium. We will us...