Selenium WebDriver – Insert Verification Point

A verification point is a specialized step that compares two values and reports the result. A verification point compares the actuals from the test run, with the expected results in the test case.

You use a checkpoint to:

  • Verify the state of an object
  • Confirm that an application performs as expected

A verification point checks whether an application responds appropriately when a user performs tasks correctly while testing application. A verification point ensures that a user is barred from performing certain tasks and confirms that invalid or incomplete data are flagged with appropriate messages. Read More

Selenium WebDriver – Methods

While working with Selenium we need to use Java as well as Selenium WebDriver functions. WebDriver provides various methods to perform different actions on Web elements.

Common Selenium WebDriver Methods

Common elements methods for UI interaction

The following lists show details of some of the methods that selenium provides to perform actions on different web elements (listbox, editbox, checkbox, radio button) depending upon their type. Read More

Selenium WebDriver – Creating First Script

Recording and Exporting Script from IDE

We will record the test case using Selenium IDE and then export the test case using Java / JUnit 4 / WebDriver option. Follow the steps given below:

Step 1: Open Selenium IDE and verify that recording mode is ON

Step 2: Assuming that application Google search is already open in Firefox browser, Perform the following steps in IDE recording mode:

  • Search for an automationtutorial.com
  • Click on search button
  • Click on automationtutorial.com
  • Click on Selenium link in automationtutorial.com header

Read More

Selenium Webdriver- Environment Setup

To be able to use WebDriver for scripting, there are some pre-requisites that need to be in place like the basic environment setup. Users have to ensure that they have the initial configuration done. Setting up the environment involves the following steps.

  • Download and Install Java
  • Download and Configure Eclipse
  • Configure Selenium WebDriver

Download and Install Java

Read More

Selenium – Basics of Java Part 3

Working with Classes, Objects and Methods

Declaring Classes – You have seen classes defined in the following way:

Class MyClass {

// field, constructor, and

// method declarations

}

This is a class declaration. The class body contains all the code that provide for the lifecycle of the objects created from the class.

In general, class declarations can include these components, in order: Read More

Selenium – Basics of Java Part 2

Language and Syntax Basics

Variables

The Java programming language is statically-typed, which means that all variables must first declared before they can be used.

Example – int gear=1;

Data Type Default Value
Byte 0
Short 0
Int 0
Long 0L
Float 0.0f
Double 0.0d
Char \u0000′
String Null
Boolean FALSE

The Java programming language defines the following kinds of variable: Read More

Selenium – Basics of Java Part 1

We will focusing on Java as a programming language in selenium WebDriver we need to be comfortable with the basics of Java. This topic we will discuss about basic concepts around Java language, Syntax for basic Java statements, exception handling and concept of classes and objects.

Key Objectives:

  • Object oriented programming concepts
  • Language and syntax basics
  • Object, classes and method
  • Exception Handling

Read More

Selenium – IDE User Extensions

We can extend Selenium IDE by adding customized actions, assertions and locator-strategies. It is done with the help of JavaScript by adding methods to the Selenium object prototype. On start-up, Selenium will automatically look through the methods on these prototypes, using name patterns to recognize which ones are actions, assertions, and locators.

Let us add a ‘while’ Loop in Selenium IDE with the help of JavaScript. Read More

Selenium – IDE Editing Test Steps and Adding Verification Points

You can not only edit the steps inside the selenium IDE but you can also add new steps or change the sequence of steps inside the IDE itself.

To do that we need to understand the following –

Test Case Table Pane – Your script is displayed in the test case pane. It has two tabs, one for displaying the command and their parameters in a readable “table” format as shown below. Read More