Selenium Tutorials 31+ Best Free Selenium Training Tutorials

After hundreds of requests from STH readers, today we are finally launching our FREE Selenium Tutorial series. In this Selenium training series we will cover all Selenium testing concepts and its packages in detail with easy to understand practical examples.

These Selenium tutorials are helpful for beginner to advanced level Selenium users. Starting from the very basic Selenium concepts tutorial, we will gradually move on to the advanced topics like Framework creation, Selenium Grid and Cucumber BDD.

Selenium Tutorials

Note: We will be increasing our article posting frequency for this series. Please don’t miss any tutorial. Keep track of all the tutorials by bookmarking this page as we will keep updating it with links to all new Selenium tutorials.

**********************************

Here we are listing all the Selenium Training Tutorials for your handy reference.

List of Selenium Online Training Tutorials:

Selenium Basics:

Selenium WebDriver:

Selenium Framework:

Advanced Selenium:

Selenium Tips and Interview Preparation:

**********************************

How to start Learning Selenium?

This is the best time to start learning Selenium testing by your own with the help of this free Selenium Training series. Read tutorials, practice examples at your home, and put your queries in comment section of respective tutorials. We will address all of these queries.

Experienced Selenium professionals – you too can take part in this series by providing answers to reader’s queries in comments.

This is our serious effort to help you learn and master one of the most popular software testing tools!

Selenium Introduction:

We are delighted to launch our yet another series of software testing training tutorials. The belief behind introducing this tutorial is to make you an expert in a widely used software test automation solution, Selenium.

In this series we will look at the various facets of Selenium. Selenium is not just a tool; it is a cluster of independent tools. We will look into some of the tools in detail, providing practical examples wherever applicable.

Before you jump in to reading this exciting and useful series, let us take a look at what it has got in store for you.

Why Selenium?

As the current industry trends have shown that there is mass movement towards automation testing. The cluster of repetitive manual testing scenarios has raised a demand to bring in the practice of automating these manual scenarios.

The benefits of implementing automation test are many; let us take a look at them:

  • Supports execution of repeated test cases
  • Aids in testing a large test matrix
  • Enables parallel execution
  • Encourages unattended execution
  • Improves accuracy thereby reducing human generated errors
  • Saves time and money

All this results in to the following:

  • High ROI
  • Faster GoTo market

Automation testing benefits are many and well understood and largely talked about in the software test industry.

One of the most commonly asked question comes with this is –

  • What is the best tool for me to get my tests automated?
  • Is there a cost involved?
  • Is it easy to adapt?

One of the best answers to all the above questions for automating web based applications is Selenium. Because:

  • It’s open source
  • have a large user base and helping communities
  • have multi browser and platform compatibility
  • has active repository developments
  • supports multiple language implementations

First glance at Selenium

Selenium is one of the most popular automated testing suites. Selenium is designed in a way to support and encourage automation testing of functional aspects of web based applications and a wide range of browsers and platforms. Due to its existence in the open source community, it has become one of the most accepted tools amongst the testing professionals.

Selenium supports a broad range of browsers, technologies and platforms.

(Click on image for enlarged view)

Selenium intro 1 new

Selenium Components

Selenium is not just a single tool or a utility, rather a package of several testing tools and for the same reason it is referred to as a Suite. Each of these tools is designed to cater different testing and test environment requirements.

The suite package constitutes of the following sets of tools:

  • Selenium Integrated Development Environment (IDE) Selenium intro 2
  • Selenium Remote Control (RC) Selenium intro 3
  • Selenium WebDriver
  • Selenium Grid Selenium intro 4

Selenium RC and WebDriver, in a combination are popularly known as Selenium 2. Selenium RC alone is also referred as Selenium 1.

Selenium intro 5

Brief Introduction to Selenium tools

Selenium Core

Selenium is a result of continuous efforts by an engineer at ThoughtWorks, named as Jason Huggins. Being responsible for the testing of an internal Time and Expenses application, he realized the need for an automation testing tool so as to get rid of repetitive manual tasks without compromising with the quality and accuracy.

------------

As a result, he built a JavaScript program, named as “JavaScriptTestRunner” in early 2004 that could automatically control the browser’s actions which seemed very much similar to that of a user communicating with the browser.

Henceforth, Jason started demoing the tool to the vast audience. Eventually the discussions were laid out to categorize this tool in the open source category as well as its potential to grow as a re-usable testing framework for other web based applications.

The tool was later on acclaimed with the name “Selenium Core”.

Selenium IDE (Selenium Integrated Development Environment)

Selenium IDE was developed by Shinya Kasatani. While studying Selenium Core, he realized that this JavaScript code can be extended to create an integrated development environment (IDE) which can be plugged into Mozilla Firefox. This IDE was capable of recording and playing back the user actions on a Firefox instance to which it was plugged-in. Later on Selenium IDE became a part of Selenium Package in the year 2006. The tool turned out a great value and potential to the community.

Selenium IDE is the simplest and easiest of all the tools within the Selenium Package. Its record and playback feature makes it exceptionally easy to learn with minimal acquaintances to any programming language. With several advantages, a few disadvantages accompanied Selenium IDE, thus making it inappropriate to be used in cases of more advanced test scripts.

Advantages and disadvantages of Selenium IDE:

Selenium intro 6

The disadvantages of IDE are in reality not disadvantages of selenium, rather just limitations to what IDE could achieve. These limitations can be overcome by using Selenium RC or WebDriver.

Selenium RC (Selenium Remote Control)

Selenium RC is a tool which is written in java that allows a user to construct test scripts for a web based application in which ever programming language he/she chooses. Selenium RC came as result to overcome various disadvantages incurred by Selenium IDE or Core.

Loopholes and restrictions which were imposed while using Selenium Core made it difficult for the user to leverage the benefits of the tool to its totality. Thus it made the testing process a cumbersome and a far reaching task.

One of the crucial restrictions was same origin policy.

Problem of same origin policy:

The problem of same origin policy disallows to access the DOM of a document from an origin that is different from the origin we are trying to access the document.

Origin is a sequential combination of scheme, host and port of the URL. For example, for a URL http://www.seleniumhq.org/projects/, the origin is a combination of http, seleniumhq.org, 80 correspondingly.

Thus the Selenium Core (JavaScript Program) cannot access the elements from an origin that is different from where it was launched.

For Example, if I have launched the JavaScript Program from “http://www.seleniumhq.org/”, then I would be able to access the pages within the same domain such as “http://www.seleniumhq.org/projects/” or “http://www.seleniumhq.org/download/”. The other domains like google.com, yahoo.com would no more be accessible.

Thus, to test the application using Selenium Core, one has to install the entire application on the Selenium Core as well as web server to overcome the problem of same origin policy.

Selenium intro 7

So, In order to govern the same origin policy without the need of making a separate copy of Application under test on the Selenium Core, Selenium Remote Control was introduced. While Jason Huggins was demoing Selenium, another fellow colleague at ThoughtWorks named Paul Hammant suggested a work around of same origin policy and a tool that can be wired up with a programming language of our choice. Thus Selenium RC came into existence.

Unlike selenium IDE, selenium RC supports a wide range of browsers and platforms.

Selenium intro 8

Workflow Description

  • User creates test scripts in a desired programming language.
  • For every programming language, there is a designated client library.
  • Client library deports the test commands to the selenium server.
  • Selenium server deciphers and converts the test commands into JavaScript commands and sends them to the browser.
  • Browser executes the commands using selenium core and sends results back to the selenium server
  • Selenium server delivers the test results to the client library.

There are a few pre-requisites to be in place before creating Selenium RC scripts:

  • A Programming Language – Java, C#, Python etc.
  • An Integrated Development Environment –Eclipse, Netbeans etc.
  • A Testing Framework (optional) – JUnit, TestNG etc.
  • And Selenium RC setup off course

Advantages and disadvantages of selenium RC:

Coming on to the advantages and disadvantages of selenium RC, refer the following figure.

(Click on image for enlarged view)

Selenium intro 9

Selenium Grid

With selenium RC, life of a tester has always been positive and favorable until the emerging trends raised a demand to execute same or different test scripts on multiple platforms and browsers concurrently so as to achieve distributed test execution, testing under different environments and saving execution time remarkably. Thus, catering these requirements selenium grid was brought into the picture.

Selenium Grid was introduced by Pat Lightbody in order to address the need for executing the test suites on multiple platforms simultaneously.

Selenium WebDriver

Selenium WebDriver was created by yet another engineer at ThoughtWorks named as Simon Stewart in the year 2006. WebDriver is also a web-based testing tool with a subtle difference with Selenium RC. Since, the tool was built on the fundamental where an isolated client was created for each of the web browser; no JavaScript Heavy lifting was required. This led to a compatibility analysis between Selenium RC and WebDriver. As a result a more powerful automated testing tool was developed called Selenium 2.

WebDriver is clean and a purely object oriented framework. It utilizes the browser’s native compatibility to automation without using any peripheral entity. With the increasing demand it has gained a large popularity and user base.

Advantages and disadvantages of Selenium WebDriver:

Refer the following figure for the advantages and disadvantages of WebDriver.

(Click on image for enlarged view)

Selenium intro 10

Selenium 3

Selenium 3 is an advance version of Selenium 2. It is a tool focused for automation of mobile and web applications. Stating that it supports mobile testing, we mean to say that the WebDriver API has been extended to address the needs of mobile application testing. The tool is expected to be launched soon in the market.

Environment and Technology Stack

With the advent and addition of each new tool in the selenium suite, environments and technologies became more compatible. Here is an exhaustive list of environments and technologies supported by selenium tool set.

Supported Browsers

Selenium intro 11

Supported Programming Languages

Selenium intro 12

Supported Operating Systems

Selenium intro 13

Supported Testing Frameworks

Selenium intro 14

Conclusion

In this tutorial, we tried to make you acquainted with the Selenium suite describing its various components, their usages and their advantages over each other.

Here are the cruxes of this article.

  • Selenium is a suite of several automated testing tools, each of them catering to different testing needs.
  • All these tools fall under the same umbrella of open source category and supports only web based testing.
  • Selenium suite is comprised of 4 basic components; Selenium IDE, Selenium RC, WebDriver, Selenium Grid.
  • User is expected to choose wisely the right Selenium tool for his/her needs.
  • Selenium IDE is distributed as a Firefox plug-in. It is easier to install and use. User is not required to possess prior programming knowledge. Selenium IDE is an ideal tool for a naive user.
  • Selenium RC is a server that allows user to create test scripts in a desired programming language. It also allows executing test scripts within the large spectrum of browsers.
  • Selenium Grid brings out an additional feature to Selenium RC by distributing its test script on different platforms and browsers at the same time for execution, thus implementing the master slave architecture.
  • WebDriver is a different tool altogether that has various advantages over Selenium RC. The fusion of Selenium RC and WebDriver is also known as Selenium 2. WebDriver directly communicates with the web browser and uses its native compatibility to automate.
  • Selenium 3 is the most anticipated inclusion in the Selenium suite which is yet to be launched in the market. Selenium 3 strongly encourages mobile testing.

In the next tutorial, we would be discussing about the basics of Selenium IDE, its installation and its features. We would also have a look at the basic terminologies and nomenclatures of Selenium IDE.

Next Selenium Tutorial: Introduction to Selenium IDE and its installation with detailed study on all the features of Selenium IDE (coming soon)

A remark for the readers: While our next tutorial of the Selenium training series is in the processing mode, meanwhile you can explore a bit about the Selenium suite and its tools by looking at its official website.

About the authors:
Shruti Shrivastava (our main author for this series), Amaresh Dhal, and Pallavi Sharma are helping us to bring this series to our readers.

Shruti is currently working as a Senior Test Engineer with 4+ years of automation testing experience. She is an ISTQB certified professional and also an active blogger, always interested in solving testing related problems.

Amaresh is having 5+ years of manual and automation testing experience with expertise in WebDriver, Grid and frameworks.

Pallavi Sharma has more than 7 years rich experience of working in automation testing field with hands-on Selenium and JAVA experience.

Stay tuned till then and share your views, comments and knowledge to help us groom. Also let us know if you find anything that we missed out so that we can include them in the subsequent tutorials.

Recommended reading

175 comments ↓

#1 Himanshu

please provide more notes on webdriver.

#2 kotla

Hi ,,
thanks for the selenium tutorial ; and please tell me as a newbie how much ‘Java’ language is required to learn webdriver and selenium rc … Can you provide some insights on it.

thanks
kotla

#3 SwetaC

Thank you so much STH. Introduction is very clear. Looking for all tutorials.

#4 Kotturi

Hi
Thanks for the selenium tutorial.
Please tell me more on Web driver & Mobile Apps

Thanks
Kotturi

#5 Dwarika

Seems one of the best researched and groomed article on Selenium mainly on its introduction.

Presentation is fantastic and easily digestible and each diagram is having the concept of 5 lakhs word in a single image.

Thanks for posting and thumbs up to its author..

#6 Luke

Awesome Guys!! This Tutorial is Exactly what I’ve been looking for, for a very Long Time….Clear, Informative, straight to the Point, I’m looking fwd to learn from the rest of it :-)

Thank you So Much!!

#7 Henk Noppe

great. looking for posts on all important topics.

#8 vandana

Hi

Thanks for this selenium tutorial ,
and it is very use full

#9 Luke

AWESOME Guys, thank you So Much for this Series of Free Tutorials on Selenium 2.

Luke

#10 aryan

Thanx to STH

#11 sukhjinder

Hi there
I am glad to find this website and looking forward to learn about software testing. I have passed my Microsoft certificate in HTML5, CSS3 and JavaScript.
I want to be a software tester.
Please help me to find exactly focused path in this field.

#12 Vijay

Thanks for sharing such a wonderful tutorials… Hope to see more topics on Selenium soon :)

#13 Rajkumar J.B

Very Good work. Appreciate all of you. All the very best for your future series.

#14 gurpreet

most awaited post it was… thanks .. looking for more posts … :)

#15 Shruti Shrivastava

@Himanshu

Thank you for comment. We would be soon sharing tutorials on WebDriver once we cover the basics of Selenium IDE. Stay tuned, you would find a lot more on WebDriver in the store later in the series.

#16 Shruti Shrivastava

@kotla

Thank you for your comment. As far as your query is concerned, i would say you need not to be a pro in java to learn Selenium RC or WebDriver. All you need is a little knowledge on basic java constructs like loops, conditional statements, datatypes, classes, objects and OOPs concepts which you can learn beside WebDriver or RC.

The more you try and practice WebDriver, the more you will expand your expertise in the language.

#17 Sudhakar

Hi,

Thanks for the article..It is very informative.

#18 Sridevi

Hi,

Thanks for the information. Very clear and easy to understand. Can you plz tell me how to install selenium suite?

#19 shanmugaraj

Thanks for you work dude…Looking forward for your next post..;)

#20 Vamsi

Nice article and info is very useful, looking forward for next edition..:)

#21 Shruti Shrivastava

Thank you all for the appreciative words.

#22 Shruti Shrivastava

@Kotturi

Thank you for comment. We would be soon sharing tutorials on WebDriver once we cover the basics of Selenium IDE. Stay tuned, you would find a lot more on WebDriver in the store later in the series.

#23 Shruti Shrivastava

@Dwarika

Thank you Dwarika for the appreciation and kind words.

#24 Shruti Shrivastava

@Luke

Thank you for the appreciation and kind words.

#25 Shruti Shrivastava

@Sridevi

Thanks for your comment. You won’t have to wait much for the installation as our next tutorial is based on installation of Selenium IDE.

#26 Nagababu Sattineni

Nice Article..!

Looking forword for next tutorials.

Thanks.

#27 Roopesh

Most Awaited Tutorial Series

I Request many times for Selenium

Egarly waiting for Frame Works

#28 Saurabh

Thanks a lot for this wonderful tutorial.

#29 Chetan Metkar

Firstly thanks to all STH team to presents a selenium tutorial series.specially thanx to vijay sir.
Its a very useful and osm tutorial and useful information cover all that things.

#30 Anu

I am a big fan of this site. I like the way the article is presented. Hope to learn selenium web driver. Can’t wait for the next tutorial?

#31 Kirthika Ragunath

Hi team,

You all have done great research and have brought out this

tutorial to be really awesome. Great effort and continue this

work.

#32 Supriya

Thanks for this
Selenium tutorial. It’s very much helpful for the beginners.

#33 Shruti Shrivastava

@Chetan

Thank you for your appreciative words.

#34 Shruti Shrivastava

@Kirthika

Thank you for your appreciative words.

#35 omar

,,All this results in to the following:
•High ROI
•Faster GoTo market,,

thanx for this articles , in the above text
What is meant by : RoI

#36 Shruti Shrivastava

@Omar

ROI is Return on Investment

#37 omar

Hi

The most important question I have :

Can selenium That is to portray what the user of the scenarios examined as Video ?
or at least screen shot

#38 omar

What is meant by : Doc document

#39 Chetan Metkar

@shruti mem

hey mem,pls post tutorial#…

we all are waiting for next part of this turorials…

#40 Mamatha

Nice Article …very helpful for beginners of automation tools…

#41 omar

@ Shruti Shrivastava

Thank you for this effort and the fact that material is beautiful and a good effort and we are waiting for the next lessons
But is it possible to put the references that you collect information from them
Thank you

#42 Shruti Shrivastava

@Chetan

Vijay is planning to launch the publish of next set of articles soon.

#43 Shruti Shrivastava

@Omar,

Thank you for your kind words.
Vijay is planning to launch the publish of next set of articles soon.

#44 Shruti Shrivastava

@Mamatha

Thank you for the appreciation.

#45 nikitha

Thanks for your selenium basics it is very useful.please release selenium components description

#46 Tarun Sharma

Hi
My query is for using selenium for mobile applications Android Testing.

#47 Mohan

Thanks for sharing such a useful article from basic & expected one.

The words & the way of explanation is awesome. Also, very easy to understand for beginner too. Thanks again.

#48 Deepika

Thank you STH team for providing us the Selenium tutorial for learning, free of cost and very descriptive and in easy method. Looking forward for more informative releases.

Thanks Again!!

#49 Nitin

Hi,

Can I get the PDF of every tutorial. It will easy for me to get printouts & go through. Its bit difficult to sit online for every tutorial. Please respond.

#50 Vinod

A good start…Thank u..

#51 mfly

This article is great. I have been trying very hard to study and understand Selenium but reading this has helped me a great deal.

#52 puneet

thankyou all three of you. very nicely organised tutorial. full informative.

#53 Dhanya PB

Thank you very much for this most awaiting tutorial!! The tutorial will definitely help a software tester to become an expert in automation using Selenium. Once again thank you so much!!

#54 Lawrence Francis Xavier

Very Happy, i was awaiting for such an excellent tutorial on Selenium in STH

Very much thanks to the author

#55 Kranthi

Thanks for providing and we need a dummy project lyk how we implemented in real time for a specific project

#56 Bharadwaj

Hi Shruthi,

Thanks for the wonderful intro, but have below questions after going through this article please answer to clarify

1. What is meant by a testing framework and What are different testing frame works that selenium supports

2. Reason for RC doesn’t directly communicate with web browser
3. What is meant by direct communication with web browser? Any Examples
4. Advantages of selenium compared to QTP?

#57 Sappz

Thanks very much for this tutorial

#58 santoshi

hi
i have one dought to take selenium clasess
i do not know any programing languge so can i learn selenium?

#59 priyeshq

thanks really helpful…..\

#60 Priyanka

Great article…..As always…:)

#61 Ishita

Great article…..want to learn more through vidoes visit way2automation

#62 Parul

This is a great series of Selenium, I have learn till now.
One small request I want to convey that, it will be great if you include how to handle captcha in any registration form

#63 prashanthi

thanku yo so much for the free selenium tutorial.It is very clear and simple to understand.

#64 Natalya

I’ve learnt Java basics from the book Java For Testers by Alan Richardson

#65 arjun

Awesome Tut.Use HTTrack software to download all the links in jst 2 mnts

#66 Pavan

Hello trio ,

I have read all the given information and it is well to understand .

I am clear about selenium till you explain and that is result of your work.
Can you please share expected date of your next doc. every one get it when it release ..:)

#67 Shruti Shrivastava

@Pavan

Thank you for the appreciative words…
All the selenium tutorials are already launched. You can find them over the website. Also, in the beginning of the page, the links to previous and next article is given.

#68 Thomas

Thanks for your help….this is the best tutorial i found in internet.

Thanks a lot and go on with your work.

#69 Hammed

Great Explanation of Selenium for beginners and I hope to learn step by step of this tutorial.

#70 Jay

Great presentation and explanation. This is very good info for new starts.
When will Selenium 3 be released?

#71 vivek

Hello,

can any one tell me when we have to write automation script?

before development(i.e. like test case) or after development of project.

#72 Gaurav

Hello
Please tell me how can i test a web application from selenium IDE.

#73 Poorni

Awesome Intro about selenium…. Thanks for the wonderful information….. Keep going… All the best….

#74 Rohan

Thanks for the Information!
Very short and descriptive article..

#75 Prachi

This is the best free online tutorial i have ever seen on the internet. Has helped me a lot. Even though I am an experienced tester but it serves as a lifeline whenever I am stuck. Thanks a lot team STH.

#76 Rehan

Thanks For the wonderful information of selenium ….i like it more….keep going. thanks STH team.

#77 Sandeep

Nice work Shruti…Can you please email me some examples which are implemented using Framework @Sandeep.008d@gmail.com

#78 surendra

Thanks for providing the details of selenium.i have one doubt please clarify.
i.e,
after recording the application i want to check the script in manually for all the text scenarios.how to passing the parameters.

#79 mahboob

thanks, i learned a lot from this tutorial but i have some questions after reading this
1. how we can start it by writing a simple script suppose to login an application using selenium automation tool
2. Secondly how much we have to learn java programming language

#80 Raj Gurung

Hi,
In order to learn Selenium, apart from Java what all extra we nedd to know???
Thanks in advance

#81 Raj Gurung

Hi,
this book mentions chapters 1, 2, 3,4 and directly 022. where are chapters 5,6,…..???
thanks in advance

Java For Testers
Learn Java fundamentals fast
Alan Richardson
This book is for sale at http://leanpub.com/javaForTesters
This version was published on 2014-06-13

#82 Raj Gurung

Hi,
Java for testers book mentions chapters 1, 2, 3, 4 and 022. Where are in between chapters 5, 6, 7….., and 021 ???
Thanks in advance

#83 Abhishek Pandey

Its a very helpful article. Obviously you guys put lot of efforts in doing that.
Keep up this Good Work.

#84 Jayanthi

Thank you for your wonderful service, you are helping for people in a different way, your way of presentation is very simple and very clear, easy to understand. Please continue your service.

#85 Omkar

Thanks for sharing this very important information.
Nice Work.

#86 Naveen S

Dear Shruthi,

I just came to know and gone thru first tutorial..I really wasted much time and dint able to realise there is something in STH what exactly any tester needs..the presentation is awesome..and the way u reply to the comments is really encouraging…now i dont want to waste my time…lots of thanks..

#87 Tanushri

Hey Shruti awesome explanation, just started with the first tutorial and wana cover all 31 in few days time so that I can get better knowledge and practical experience on webdriver.

#88 Suma

Thanks for the awesome explanation. Can’t wait to finish all the tutorial’s. Once again thanks for the whole team who ever are contributing their time and effort.

#89 lipi

Hi Shruti,

I have one question. What type of URL can be accessed by selenium? Because I face error when i enter URL having ip address.

Hope you are getting my point.

#90 pooja

WebDriver is also a web-based testing tool with a subtle difference with Selenium RC. Since, the tool was built on the fundamental where an isolated client was created for each of the web browser; no JavaScript Heavy lifting was required. This led to a compatibility analysis between Selenium RC and WebDriver.

what does author mean by this??

#91 Mounica B

Hey Shruti the presentation is awesome…I have one question to ask…Which one is best to be used with selenium to automate a Web based application? Is it Nunit or TestNG? Please reply asap…

#92 sind

hi,

Can you please help me in suggesting a preferred language to a new project which is going to start doing selenium automation.

#93 Phaneendra

Hi all,

I am using Windows 8.1 and IE 11 and firefox 37 versions.
I am trying to execute my selenium program, I am getting an exceptions. Can anyone resolved my issue

My sample code is
===============

package com.phani.first;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;

public class Consts {

@Test
public static void createBasicAccount()
{
WebDriver driver = new FirefoxDriver();
driver.get(“http://www.paymants.amazon.com/overview”);
//driver.findElement(By.xpath(“”)).sendKeys(“”);
driver.close();
}
}

My TestNG result is
=================

[TestNG] Running:
C:\Users\lenovo\AppData\Local\Temp\testng-eclipse–1106206622\testng-customsuite.xml

FAILED: createBasicAccount
java.lang.NoClassDefFoundError: com/google/common/base/Function
at com.phani.first.Consts.createBasicAccount(Consts.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Function
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
… 25 more

===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================

===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@626b2d4a: 19 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@73a8dfcc: 46 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@6f2b958e: 11 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 7 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@aec6354: 63 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@c2e1f26: 8 ms

Please, resolved my issue. and also tell me i need to change my OS or i need to make code changes or anything else… Thank you in advance…

#94 Yatharth Jain

Want Online Course…

#95 shri

Arguably the best readable selenium training material I came across. Easy, clear, comprehensive… good work!!

#96 Debanjan

It will be great if we were showed videos of how to work with Selenium core and RC.

In that scenario a hands-on approach would render it manageable for beginners like us to understand Selenium

#97 Nandan L G

Thanks for great tutorial. Best stuff found on internet

#98 Jai Patel

Hi,
Nice tutorial, Its very useful but something missing.
please provide the at least one complete example of IDE, WebDriver and RC with testing.

Good Work..

#99 vijayalakshmi

Hi Vijay,

I am working as a QA Engineer in streaming area which involves testing on Video on demand,cable tv, OTT etc. Can you please start a tutorial on this.

Thanks

#100 Shruti

@Mounika

Nunit is a unit testing framework specifically for dotnet where as Junit or TestNG are used for Java.

If you ask me which one should you use amongst Junit or TestNG, then i would definitely suggest you to use TestNG as it is a newer framework with lots of advance features.

#101 nancy

How to create test case for login page in selenium ide if there exists captcha code.

#102 Tanushri

Hi Vijay, I need your help in setting up Selenium Webdriver environment in my system. My both system has Windows 7 & 8 and Java 32 bit. Please help me with the right eclipse version which can identify selenium commands. I tried many of the eclipse version which throws typical error in sendkeys command. Thanks for such a nice tutorial which I am trying to follow and learn.

#103 Ramanuj

Thanks for this article post. It is really useful introduction for beginners.

#104 Pankaj

Awesome tutorial but given some examples with webdrivers

#105 Hitesh

Thanks for the article!
It’s really gonna help me.
Thanks.

#106 gayathri

what are all the basic things i should have to know before starting selenium tutorial?
can u pls tell me

#107 Arun

Good and useful article.

#108 xyz

Hi,
I am unable to automate the Authentication popup. I am doing this for the Dynamic CRM. Please help me out with this.

#109 Gaurav Khurana

Very nice article to start . Congrats Shruti Shrivastava for writing in such a nice way with 4 years of experience… keep writing…. where can we follow you,, share your twitter blog etc

#110 prem

hello all of you
if any of you project on selenium please mail it to me to given below address
prem0999@gmail.com

#111 Manjunath Prabhu

Thanks to all Software Testing Help team to presents a selenium tutorial series.
Its a very useful tutorial for a beginner to learn from scratch.
Thanks!

#112 spandana

wat does High ROI mean?

#113 ahsan khokhar

nice article ,,
its helpfull to me..thanks

#114 Vijayakumar.M

i want good job pls help

#115 manjunath

hi
is this the window to communicate during a training session

#116 SKapoor

Thanks for the very informative article.

#117 Pawan

Hi,

My question is on whether to chose selenium as a career or QTP ?? I have 12 years of Managing a business development of financial services in India. Got a chance to be in US and want to settle here… Confused on choosing selenium or QTP..?? I dont have any experience in IT. I have a year to set my career here. Kindly advice

#118 Vamsi D

Thanks for info, everything about selenium is available at one source.

#119 Dhaval Shah

I would like to get training on Selenium. So, can you please let me know what will be training duration and fees for the same?

#120 Manikandan

Hi, Can you any one tell me “Free automation tool” is available in Market for Mobile application (iOS & Android apps)?

#121 natraj

im new in selenium web drive testing, so briefly explain that concept.

#122 Pawan Juyal

I this tutorial available in PDF format?
It’ll be great if it is..

#123 prabin

@ spandana ROI means Return on Investment

#124 Parag

Thanks a lot for this much awaited tutorial. Nicely written so easy to understand. Great job Team STH.

#125 TANAYA

Thank u for your dedication towards us.

#126 Devi

Nice One!!!

#127 Sundus Ahmad

Very nicely explained that can be easily understood.

#128 Nagappan

Thank you so much!

#129 Hari Notam

Good content

#130 Vaibhavi Aithal

I am working on a automation script to have it working on both browsers (Firefox and Chrome)

I have located element individually in both browsers as well with there respective tools (For ex: Identified relative xpath for an element which is common and element is located in both the browsers).

Now the issue is that the scripts are working in firefox but the same set of scripts are not working in chrome. due to its not able to identify elements

While running in chrome it gives below message:
“Element is not click-able at point(x,y) ”

I have tried with the methods to overcome this kind of issues by searching in google and relevant sites but those are not working. So, if anyone knows regarding this kind of issues and probable methods to resolve then request to please let me know.

#131 Hitendra Parmar

does the selenium support the all the language like .net or VB if have to test the application and which selenium tools will be usedful

#132 Mahesh

thanku guys …. Great Job

#133 sagar kulkarni

Thanks u r doing nice social work.

#134 Smith Gobade

does the selenium support the all the language like .net or VB if have to test the application and which selenium tools will be usedful

#135 Raj

Urgent requirement for selenium trainers both offline & online

HI Guys!

thanks for the all the information provided above , some of the information is really helpful.

Note:- There is a urgent requirement for selenium trainer for both offline & online classes in bangalore.if any one are interested can contact me @ rajkconsultancy or 9164530165

#136 Aravinth Raj

It was Clear and Straight to the Point, I’m looking fwd to learn from the rest of it !! :)

#137 Pratik Vaghasia

Thank you very much. This series is very helpful.

#138 Ranjith

Hi There,

Can you explain what is happening in real time agile methodology in company. How they are implement agile and from bigining to project realise.

#139 paritosh

Hi

I have around 3 years of exp in java dev and i do manual testing as well ,as i am working on the mantinace project so i do frequents changes and do unit testing now i am finding more interest in testing means i have to develop my career in testing …..please give some direction…

#140 Kapil

Please share knowledge about how to test fields like Editor,Drag&Drop & Panel in Selenium.

#141 Kanth

You Guys Really ROCK ,OMG , such a useful content for any one , who is confused from where to start on Selenium.
Stupendous Job . Great work . I can’t stop myself without praising .KUDOS the whole softwaretestinghelp, infact i have been following this site since lang.

#142 santoshi

hi,

i want to learn selenium testing.

i don’t no any programming language.

is it possible to learn selenium

#143 Jadian softaere

I have read your post and very much pleased to know about Field Automation Software.
I will keep your tips in mind in my future business solutions. Also find more info about it, visit :
jadian.com

#144 pragati

thanx…..very much.but please can u mail me this selenium material please.

#145 mazhar

Can i have this selenium tutorial fully in pdf format. thanks

#146 Venkat

Why should we use System.SetProperty for Chrome and IE browsers?

#147 Geetha

Hi,

I am a beginner . Can you please explain more on ‘Selenium has active repository developments’

#148 satendra kumar

Hi,

I am a beginner . Can you please explain more on ‘Selenium has active repository developments’

#149 pradeep jain

hi i m using firefox 43 version and selenium 2.53 version but it did not respond

error show.

noexception connection.

please tell me which selenium version is suitable for firefox version.

#150 Manick

Hi jieee,

Nice tutorials ,super jieee, continue your services.. easily understand concepts..THank U jieee Magizhichi

#151 vijay

Hi geetha don’t worry..i will help you.

#152 vijay

hi all,

You people have any doubts or queries(cuz i have too) send me an email:
“l.vijay.kumar225@gmail.com” we will discus.

#153 Kapil

Awesome article!!! Really great work in getting this thing together. Appreciate your efforts. Thank you!!!

#154 Nagarani

What is the difference between WAP based applications testing and Mobile testing?

WebDriver Supports WAP based applications testing and doesn’t support mobile testing didn’t understood this point.pls clarify anybody

#155 ashwini gadade

hi.sir
i m trying to download selenium 2.53.1 version but whatever file i download it is in win RAR zip ?so how to convert that file? reply me

#156 Chirag

Hey,

Thanks for sharing the history behind Selenium which is so well written in very precise manner.

Regards,
Chirag

#157 Suresh

If anybody wants a pdf version of every tutorial, then use the site http://pdfcrowd.com/ to convert each page into a .pdf file. You can generate 32 pdf files and read them offline.

#158 ramesh

I want make a excel utility using selinium MB: 9925229068 please..

#159 Natther Shah

Do we have all these topics covered in C#?? Kindly respond

#160 Kowsalya

Hi all,

I implemented page object model for my project.

Ieally the case is like this:
had the below classes in page_objects package.
home_page.java
login_page.java
my_products.java
x_product.java

then, my java class for testing.java in in another package and imports the above said packages.

All these page object model classes, has the below sample structure.

public class Account_Page {
private static WebElement element = null;

public static WebElement lnkHome(WebDriver driver){
element = driver.findElement(By.id(“lnkHome”));
return element;
}
}

One more page object model class
public class Tools_Page {
private static WebElement element = null;
public static WebElement lnkCertificate(WebDriver driver){

element =driver.findElement(By.cssSelector(“a[href*=’Certificate’]”));
return element;
}
}

main.java file will be like this:

public class test_login_logout {
private static WebDriver driver = null;
@Test
public static void main ( String[] args) throws InterruptedException,NoSuchElementException{



Account_Page.lnkTools(driver).click();
Tools_Page.lnkCertificate(driver).click();

}

I’m getting error at invoking the Tools_page method:

The below are the error:
=========================
*** Element info: {Using=css selector, value=a[href*=’Certificate’]}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByCssSelector(RemoteWebDriver.java:492)
at org.openqa.selenium.By$ByCssSelector.findElement(By.java:430)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:355)
at Page_Objects.Tools_Page.lnkCertificate(Tools_Page.java:13)
at Automation_Framework.test_login_logout.main(test_login_logout.java:54)
==========================

Please help me with this

#161 Kaizar

Hi,
I was looking for such selenium tutorial, I m really excited to learn & became an expert in Selenium ,
I want to use Selenium with Python , will it be covered ?

#162 Babu

Great intro guys..will go through all topis..

#163 sai

hi.. i m php developer and having 6 years exp.. now i m looking for diff technology.. which is the better technology for future..someone suggested selenium.. any suggestions please.

#164 Sruthi

Hello team,

Thanks for the great tutorial. I would like to know what are flash/flex objects?
what do you mean by “support implementation of listeners”

#165 Jason Daniel

Excellent content . Systematic approach for better understanding . Hats off

#166 Gopika

Great efforts put it to find the list of Selenium Training Tutorials, Definitely will share the same to other forums.
I was very much helpful.
I was looking for the same for longtime, I will be sharing the reference to other forums as well.
Keep rocking!!

#167 michael

Thank you for the tutorial, as a novice manual tester (without any programming language knowledge), i am very eager to learn automation testing and selenium. Can you suggest or upload a video tutorial on how selenium testing tool can be a useful tool?

#168 Ishwarya

Thanks for sharing a valuable information.
Yes Selenium is definitely made our lives easier with great features for automation.

Thanks a lot.

#169 Atinder

Hi, Reading this article in 2017, The article needs an Update since Selenium 3 is launched.

#170 sachin

Real very nice Coverage…Thanks..

#171 Vishal Asthana

I am new to start selenium from scratch. Please help me out to start from beginning with basic concepts.

#172 Rahul Jha

Its something which was I was looking for.
Thanks a Ton !!!

#173 atit

Just started & found this awesome stuff.

#174 Ram

package com.flipkart.pagefactory;
****************************DRIVER HOME

package com.flipkart.pagefactory;

import org.openqa.selenium.support.PageFactory;

public class DriverHome extends FlipkartBase{

public static HomePage homePage;

public static HomePage getHomePage() throws Exception {
//return PageFactory.initElements(driver, this);
return PageFactory.initElements(driver, HomePage.class);
}

}

************************************************************************HOME PAGE
package com.flipkart.pagefactory;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.junit.Assert;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import org.openqa.selenium.support.How;

public class HomePage extends FlipkartBase {

//public static HomePage homePage;
@FindBy(name = “q”)
public WebElement productSearch;

@FindBy(xpath = “//button[@class=’vh79eN’]”)
public WebElement searchButton;

@FindBy(xpath = “//input[@placeholder=’Search Brand’]”)
public WebElement searchBrand;

@FindBy (xpath = “//input[@class=’_1p7h2j’]”)
public WebElement productSelectionCheckbox;

@FindBy (xpath = “//input[@placeholder=’Search Brand’]/following::div[2]/div/label/div[1]”)
public WebElement brandSelectionCheckbox;

@FindBy (xpath = “.//*[@id=’container’]/div/div[2]/div[2]/div/div[1]/div/div/div[4]/section/div”)
public WebElement ramSelection;

@FindBy (xpath = “//div[@id=’container’]/div/div[2]/div[2]/div/div/div/div/div[4]/section/div[2]/div/div[5]/div/div/label/div”)
public WebElement GB3RamSelection;

@FindBy (xpath = “//h1”)
public WebElement resultMessage;

/* public HomePage ()
{
//System.out.println(“driver:: “+driver);
//this.homePage = PageFactory.initElements(driver, HomePage.class);

//homePage = PageFactory.initElements(driver, HomePage.class);
PageFactory.initElements(driver, HomePage.class);
//return homepage;
}*/

/*public static HomePage getHomePage() throws Exception {
//return PageFactory.initElements(driver, this);
return PageFactory.initElements(driver, HomePage.class);
}
*/
//Enter the product Type
public void selectProductType(String productType)
{
System.out.println(“STARTED”);
productSearch.sendKeys(productType);
searchButton.click();
System.out.println(“ENDED”);

}

public void selectBrandName(String brandName)
{
searchBrand.sendKeys(brandName);
brandSelectionCheckbox.click();
}
public void selectMobileRAM(String ramSize) throws InterruptedException
{
if(ramSize.equalsIgnoreCase(“3GB”))
{
System.out.println(“before ram click”);
ramSelection.click();
System.out.println(“after ram click”);
GB3RamSelection.click();
System.out.println(“after ram selection”);
}
}

public void verifyResultsStatus()
{
boolean status = resultMessage.getText().contains(“Showing 1 –”);
Assert.assertTrue(status);
}

}

***************************************************************************************BASE
package com.flipkart.pagefactory;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;

public class FlipkartBase {
public static WebDriver driver;

public static int i=10;

@BeforeSuite
/*@Parameters({“browserType”})*/

public void getDriver() throws Exception
{
String browserType = getReadConfigKey(“browser”);
if (browserType.equalsIgnoreCase(“ie”))
{
System.setProperty(“webdriver.ie.driver”, “E:\\Selenium_Training\\IEDriverServer.exe”);
driver = new InternetExplorerDriver();
}
else if (browserType.equalsIgnoreCase(“chrome”))
{
System.setProperty(“webdriver.chrome.driver”, “E:\\Selenium_Training\\chromedriver.exe”);
driver = new ChromeDriver();
}
else if (browserType.equalsIgnoreCase(“firefox”))
{
System.setProperty(“webdriver.gecko.driver”, “E:\\Selenium_Training\\geckodriver.exe”);
driver = new ChromeDriver();
}
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.get(“https://www.flipkart.com/”);
}

@AfterSuite
public void quitDriver()
{
driver.quit();
}

public String getReadConfigKey(String sKey) throws Exception
{
File file = new File(“./config.properties”);

FileInputStream fileInput = new FileInputStream(file);

Properties prop = new Properties();
prop.load(fileInput);
return prop.getProperty(sKey);
}

}
‘*******************************************************************************************
TEST SCRIPT
package com.flipkart.testscript;

import org.testng.Assert;
import org.testng.annotations.Test;

import com.flipkart.pagefactory.DriverHome;

public class SearchMobiles extends DriverHome{

//

@Test
public void verifyMobileStock() throws Exception
{
//driver.findElement(By.name(“q”)).sendKeys(“Mobiles”);

//Direct page factory usage
/*HomePage homePage= PageFactory.initElements(driver, HomePage.class);*/

//Constructor of PageClass
homePage = DriverHome.getHomePage();
homePage.selectProductType(“mobiles”);
homePage.selectBrandName(“Gionee”);
Thread.sleep(5000);
//homePage.selectMobileRAM(“3GB”);
homePage.verifyResultsStatus();
//homePage.selectMobileRAM(“3GB”);
/*String source = homePage.getPageSrc();
Boolean boolStatus = source.contains(“results”);

Assert.assertTrue(boolStatus);*/

}

}

#175 Afaroz Alam

Awesome Tutorial!!

Leave a Comment