ITSourceCode.com

Free Source Code and Tutorials

Custom Search

Category: Selenium Tutorial

Perform right click using WebDriver

In this post, we will discuss how to perform right click if we are using Selenium WebDriver for automation testing. For this purpose, we need to use Action class . Under Action class various method are defined for serving various actions that are needed to be performed while testing. For right click operation, we have […]

Share this

How do Perform Drag and Drop using WebDriver?

In this post, we will discuss drag and drop using WebDriver. For this purpose, we need to use Action class. Under Actions, class various method is defined to serve various actions that are needed to be performed. One such method is dragAndDrop(). Below is the sample code: < View plain text > java Actions action […]

Share this

How to read Excel file using Selenium WebDriver

Below is a basic code on how to read excel file. As per your requirement you can read the data for excel and play around it. < View plain text > java import java.io.File;   import java.io.FileInputStream;   import java.io.IOException;   import org.apache.poi.hssf.usermodel.HSSFWorkbook;   import org.apache.poi.ss.usermodel.Row;   import org.apache.poi.ss.usermodel.Sheet;   import org.apache.poi.ss.usermodel.Workbook;   import org.apache.poi.xssf.usermodel.XSSFWorkbook; […]

Share this

How to set test case priority in TestNG?

How to set test case priority in TestNG? Setting Priority in TestNG < View plain text > java //Code Snippet   package TestNG;   import org.testng.annotations.*;   public class SettingPriority {   // m1 , m2 and m3 are three methods   @Test(priority=0)   public void m1() {   }   @Test(priority=1)   public void […]

Share this

What are the different types of frameworks?

In this post we will discuss about different type of framework which we can use to automate browser using Selenium WebDriver. Below are the different types of frameworks: 1.Module Based Testing Framework: In this framework we divide the whole project in various isolated and independent module. This division can be either on the basis of […]

Share this

How to mouse hover on a web element using WebDriver?

How to mouse hover on a web element using WebDriver? Now a days mouse hover functionality is used by most of the developers in web application development. So it is very much important to automate this functionality too without which testing is incomplete. WebDriver offers a wide range of interaction utilities that the user can […]

Share this

How can we handle web based pop up?

How can we handle web based pop up? WebDriver offers the users with a very efficient way to handle these pop ups using Alert interface. There are the four methods that we would be using along with the Alert interface. •void dismiss() – The accept() method clicks on the “Cancel” button as soon as the […]

Share this

How to find more than one web element in the list?

At times, we may come across elements of same type like multiple hyperlinks, images, etc. arranged in an ordered or unordered list. Thus, it makes absolute sense to deal with such elements by a single piece of code and this can be done using WebElement List. Below is sample code written for the same: < […]

Share this

Frame Handling in WebDriver

In this post we will discuss about how to handle frame in WebDriver . Frame handling is very important in Web Application Testing. An inline frame acronym as iframe is used to insert another document with in the current HTML document or simply a web page into a web page by enabling nesting. In WebDriver […]

Share this

How to select a value from a dropdown ?

We can select a value from a dropdown by using WebDriver’s Select class. Syntax: < View plain text > java selectByValue: Select selectByValue = new Select(driver.findElement(By.id(“SelectID_One”))); selectByValue.selectByValue(“greenvalue”);   selectByVisibleText: Select selectByVisibleText = new Select (driver.findElement(By.id(“SelectID_Two”))); selectByVisibleText.selectByVisibleText(“Lime”);   selectByIndex: Select selectByIndex = new Select(driver.findElement(By.id(“SelectID_Three”))); selectByIndex.selectByIndex(2); < View plain text > java public Select(WebElement element) A check […]

Share this
Page 1 of 212
ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!