Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Learning Selenium Testing Tools - Third Edition

You're reading from   Learning Selenium Testing Tools - Third Edition Leverage the power of Selenium to build your own real-time test cases from scratch

Arrow left icon
Product type Paperback
Published in Feb 2015
Publisher
ISBN-13 9781784396497
Length 318 pages
Edition 3rd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Raghavendra Prasad MG Raghavendra Prasad MG
Author Profile Icon Raghavendra Prasad MG
Raghavendra Prasad MG
Arrow right icon
View More author details
Toc

Table of Contents (22) Chapters Close

Learning Selenium Testing Tools Third Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with Selenium IDE FREE CHAPTER 2. Locators 3. Overview of the Selenium WebDriver 4. Finding Elements 5. Design Patterns 6. Working with WebDriver 7. Automation Framework Development and Building Utilities 8. Mobile Devices 9. Getting Started with the Selenium Grid 10. Advanced User Interactions 11. Working with HTML5 12. Advanced Topics 13. Migrating from Remote Control to WebDriver Automation Prerequisites for Selenium Automation Answers for Self-test Questions Index

About Java programming


Java is a general-purpose computer programming language that is concurrent, class-based, and object-oriented. It includes the following functionalities:

  • Real-world programming

  • Reusability (reuse of components once created)

  • Modularity (modifying a required object without affecting the functionality of the other object)

  • Resilience to change (redefining the system without any major change in other parts)

  • Information hiding (limited access to information can be given to the user, resulting in security in a program)

How does Java work?

  1. Java programs are written in .java files.

  2. When the .java file is executed, Java Virtual Machine (JVM) will interact with one of its components, Compiler, which will convert the .java file to a .class file.

  3. Interpreter is another component of Java Virtual Machine that will interact with the .class file in runtime, that is, at the time of execution, and this provides the output.

    Note

    JVM (Java Virtual Machine) + JRE (Java Runtime Environment) = JDK (Java Development Kit)

Package

A package is a collection of classes and interfaces that provides a high-level layer of access protection and namespace management.

At a high level, its a folder where the Java classes are placed.

Class

A class defines the structure and behavior of an object or set of objects.

Objects

Objects are the basic building blocks of the OOP, and they can also be defined as an instance of a class.

Objects have the following characteristics:

  • State: The state of an object is indicated by a set of attributes and the values of these attributes.

  • Behavior: The behavior of an object refers to the change of its state over a period of time.

  • Identity: Each object has a unique identity for identification.

  • A class in the object-oriented methodology is a collection of various attributes, such as data and methods. You can access the data of a class using its methods.

    Note

    The Main method is the entry point of execution in a Java program.

Importing the sample Java project in the Eclipse workspace

The following are the steps to run the sample programs:

  1. Launch Eclipse.

  2. Import the project (File | Import | Existing Project | Java project path) MySampleJavaProject as an existing project.

  3. Enable the Navigator view on Eclipse (from Window Tab | Show View).

  4. Right-click on the .java file and select Run as Java Application.

A simple Java program example

The following is an example of a Java program:

package pckg1;
public class example1 {
  public static void main(String[] args) {
    // TODO Auto-generated method stub
    System.out.println("I am done with my 1st program on java");
  }
}

The output for the preceding code will be as follows:

I am done with my 1st program on java
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime
Visually different images