Showing posts from 2016

How to make code reusable in Java and Selenium Webdriver automation?

In this post I'm going to share kind of coding pattern which is very helpful in maintaining our automation code. This post is written insight to help beginners. We'll learn that instead of writing a linear script, we should create action methods (functions) which in general contain actions which we are going to performing on our web software. Let's say, we have a login functionality in our software and we have to automate it. In that case we'll create a method named login and write the commands like, entering username, password and click login in that method. Now we can use that method wherever we need it in other test cases as well. Benefits of using action methods are:

Code ReusabilityBetter maintainability of codeSharing below a sample script, in which I'm entering data in a web form using action methods:

Thanks for reading, share your thoughts in comments. Happy Learning! :)

Author: Vaneesh Behl
Join Telegram channel of this blog at

Mobile IOS Automation Part 1 - Appium Configuration with MAC

In recent days I got the chance to work on a Mobile Automation assignment. I got enough time for hands-on. I didn't have much experience on mobile automation before. I thought of sharing installation steps for Appium on MAC. I pen down all the configuration details and sharing below, so others could take help from it:                                                                                                                                                                                                                         MAC Configuration with Appium List of downloads:-1.Download Appium version 1.XX (.dmg) file      from Appium-master from latest android sdk.4.Install latest Xcode5.Update Android sdk witha)Latest API levelb)Android SDK Build tools, SDK tools and SDK platform-tools from toolsc)Google USB driver and Google Web-driver from extras.6.Download safari-launcher…

List of Selenium Demo Websites for Practice

In this post I’m going to share links of some demo websites/pages which Selenium beginners can use for practice purpose. Here is the list of demo websites:

1. AUtoMation Practice form
This form contains all the important form elements which we come across daily like text box, radio button, check box, select dropdown, multi-select box, button, links, File Upload, Download link. So, this form should be the first thing to automate for a beginner. Link URL:

2.Practice Web table
This webpage contains a table data. You can practice here Selenium commands to read table data. Link Url -

3.PRACTICE WindowS / Alerts
This webpage contains buttons/ links which produces new web windows, javascripts alerts etc. You can practice selenium commands to handle windows/alerts on this page

4. HTTP://AUTOMATIONPRACTICE.COM/ It’s a full featured e-commerce website simulator and my favorite. Here you can…

How To Take Partial Screenshot in Selenium Webdriver

Folks, sometimes we don't want to take screenshot of the full screen and inspite of the particular element due to some reasons. Reasons might be, full size images would last in huge memory storage for image directory or sometimes we need to take element specific screenshot due to test case requirement which makes more sense.

Sharing Webdriver's code snippet for taking partial screenshot below:

Feel free to ask queries or share your thoughts in comments or email me. Happy Coding :)
Blog Author: Vaneesh Behl
Join Telegram channel of this blog at

Set dependency among test methods in Selenium Webdriver using TestNG

TestNG provides a way to manage method dependencies with annotation parameters. For this testNg provides 'DependsOnMethods' parameter for @Test annotation. If you have declared dependency of one method on second, then first of all second method will be executed and then after first method.  Below is the code snippet:

In above code, method SignIn() is dependent on OpenBrowser() and method LogOut() is dependent on SingIn and OpenBrowser methods. 
Below is the execution sequence of above code snippet: 1. OpenBrowser 2. SignIn 3. LogOut.
Output: This will execute first (Open Browser) This will execute second (SignIn) This will execute third (Log Out)
For list of all TestNG (For Selenium Webdriver) posts click here: TestNG Posts
Author: Vaneesh Behl Join Telegram channel of this blog at Feel free to ask queries or share your thoughts in comments or email me.

List of all Selenium Webdriver commands

This post covers all the Selenium Webdriver commands with their syntax for Selenium with Java. You can find the all the commands below:

For list of  Selenium tutorials click here: Selenium Webdriver Tutorials Series Happy Learning!
Author: Vaneesh Behl Subscribe FB Join Telegram channel at Feel free to a