Free Source Code and Tutorials

Custom Search

Category: Java

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(“SelectID_One”))); selectByValue.selectByValue(“greenvalue”);   selectByVisibleText: Select selectByVisibleText = new Select (driver.findElement(“SelectID_Two”))); selectByVisibleText.selectByVisibleText(“Lime”);   selectByIndex: Select selectByIndex = new Select(driver.findElement(“SelectID_Three”))); selectByIndex.selectByIndex(2); < View plain text > java public Select(WebElement element) A check […]

Share this

How can we find if an element in displayed on the screen?

Web Application has got so much diversity. So testing a web application is a challenges that too by using an automation tool. Few element become visible immediately while others takes time to load. So automated test fails sometime.   WebDriver provides the user following methods to check the visibility of the web elements. These web […]

Share this

How to take screenshots in Selenium?

In this post we will learn how to take Screenshot in Selenium WebDriver. Taking screenshot during automated run is very important. It is useful in reporting and for better look and feel of the reports. Below is the code for taking Screenshot: < View plain text > java import; import;   import org.openqa.selenium.OutputType; […]

Share this

Difference between implicit wait and explicit wait in Selenium

An explicit wait will wait for a certain condition to occur before proceeding further in the code.There are some convenience methods provided that help you write code that will wait only as long as required. WebDriverWait in combination with ExpectedCondition is one way this can be accomplished. Below is the standard code for Explicit Wait: […]

Share this

concat() method of String class in Java

In Java, there are two ways to concatenate two strings. You can use the concat method or the plus “+” character. Sun developers are using plus operator inside the body of concat method. concat method is used for achieving more readability. The method return type is a String with the value of the String passed […]

Share this

Console class in Java

In this article we will learn about Console class in Java. In JDK 1.5 a new class was introduced under IO package i.e. Console class which is a concrete class. Although Console class is a concrete class we can’t create object of this class but we can retrieve the reference of console object by using […]

Share this
Page 2 of 41234 © 2016 Frontier Theme

Subscribe For Latest Updates

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