
Today we will learn:
1. What is Selenium
2. Features of Selenium
3. 4 Components of Selenium
4. Browsers | OS | Languages supported
References
Selenium Components -http://www.seleniumhq.org/projects/
Selenium 3 release - https://seleniumhq.wordpress.com/category/releases/
Older releases page - http://selenium-release.storage.googleapis.com/index.html
Platforms supported - http://www.seleniumhq.org/about/platforms.jsp
http://lukeis-sehq.appspot.com/about/platforms.jsp
-------------------------------------------------------------------------------------------
Correction Note : Philippe Hanrigou is the primary creator of Selenium Grid and Patrick Lightbody is co-creator of Selenium RC.
This is covered in next session - History of Selenium
_________________________________________________
Today we will learn
1. Birth of:
Selenium Core
Selenium RC
WebDriver
Selenium Grid
Selenium IDE
2. How did Selenium 1, 2 and 3 came into existence
3. Selenium release history
4. Contributors and creators of Selenium
5. Why is Selenium named so ?
6. Useful tips
-----------------------------------------------------------------------------
Selenium 2.0 announcement :
https://seleniumhq.wordpress.com/2011/07/08/selenium-2-0/
Creator of Selenium Grid :
https://mguillem.wordpress.com/2007/10/04/thoughts-on-selenium-grid/
http://theautomatedtester.blogspot.in/2008/04/selenium-grid-why-is-this-way-of-future.html
http://www.seleniumhq.org/about/contributors.jsp
Selenium 3 release :
https://seleniumhq.wordpress.com/category/releases/
Selenium old releases :
http://selenium-release.storage.googleapis.com/index.html
W3C WebDriver :
https://www.w3.org/TR/webdriver/
From the pages of history :
https://www.prismnet.com/~wazmo/blog/archives/2004_10.html
http://marc.info/?l=selenium-devel&r=1&b=200411&w=2%20-
https://github.com/SeleniumHQ/selenium
https://rubygems.org/gems/selenium-webdriver/versions
References:
Same Origin Policy Issue - http://resources.infosecinstitute.com/bypassing-same-origin-policy-sop/
________________________________________________________________
Today we will look some FAQs:
1. Why should I learn Selenium ?
2. Do I need to learn a programming language first ?
3. Can I learn selenium just for understanding concepts and use other tools ?
4. Any limitations of Selenium ?
5. How soon can I learn Selenium ?
----------------------------------------------------------------------------
References | Resources:
Google Trends:
https://www.google.co.in/trends/explore?q=%2Fm%2F0c828v
Test Automation Tools breakdown - 2016:
http://blog.testproject.io/2016/03/16/test-automation-survey-2016/
Most Popular Test Automation Frameworks:
http://blog.testproject.io/2015/12/03/worlds-most-desirable-automation-skills/
Selenium comparison chart:
https://www.google.co.in/search?q=selenium+comparison+chart&hl=en&biw=1280&bih=703&site=webhp&source=lnms&tbm=isch&sa=X&sqi=2&ved=0ahUKEwjZmsGL4ffRAhXEsI8KHahGCSwQ_AUIBigB#imgrc=NxrSudSqupmKkM:
________________________________________________________________
Today we will look some FAQs:
1. I am a Beginner, How should i start ?
2. Which tutorial / guide should i follow ?
3. Should i take some paid tutorials ?
4. Tips to become Expert in Selenium ?
Today we will learn
note: If you are using Firefox browser ver 48 or above and Selenium ver 3, Do watch the next session
Step 1 - How to do the SetUp
https://www.youtube.com/playlist?list=PLhW3qG5bs-L_qj1L5hnHvJYeFpQ_g4UuU
Step 2 - Create a Java Project in Eclipse
Step 3 - Add selenium jars
http://www.seleniumhq.org/
Step 4 - Write a program to open browser
Step 5 - Run and validate
_____________________________________________________
Today we will learn
1. How to add Selenium 3 Jars
2. How to add gecko driver
3. Run test with Selenium 3
helpful tips
interview section
References -
Webdriver interface documentation - http://seleniumhq.github.io/selenium/docs/api/java/
Selenium HQ - http://www.seleniumhq.org/
Gecko Driver Download - https://github.com/mozilla/geckodriver/releases
__________________________________________________
Today we will learn:
1. What is GECKO
2. What is Gecko Driver
3. Why selenium needs gecko driver
Refereces:
Gecko Browser Engine - https://developer.mozilla.org/en-US/docs/Gecko/FAQ
Wikipedia - Web browser engine - https://en.wikipedia.org/wiki/Web_browser_engine
Wikipedia - Comparison of web browser engines - https://en.wikipedia.org/wiki/Comparison_of_web_browser_engines
Marionette - https://developer.mozilla.org/en-US/docs/Mozilla/QA/Marionette
Marionette driver documentation - http://seleniumhq.github.io/selenium/docs/api/java/
Gecko driver releases - https://github.com/mozilla/geckodriver/releases
Today we will learn:
Step 1 - How to download ChromeDriver
Step 2 - How to set ChromeDriver in System Properties
System.setProperty("webdriver.chrome.driver", “location of chrome driver executable”);
WebDriver driver = new ChromeDriver();
Step 3 - Run test in Chrome Browser
helpful tips | interview section
References :
Selenium HQ - http://www.seleniumhq.org/
ChromeDriver exe release - http://chromedriver.storage.googleapis.com/index.html?path=2.27/
ChromeDriver exe release notes - http://chromedriver.storage.googleapis.com/2.27/notes.txt
ChromeDriver documentation - https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver
https://sites.google.com/a/chromium.org/chromedriver/
Selenium java api documenation - http://seleniumhq.github.io/selenium/docs/api/java/
______________________________________________________
Today we will learn
1. How to identify actions
2. How to make code modular
_____________________________
Step 1: Create methods for separate actions/functionality
Step 2: Copy required code from main to these methods
Step 3: Call the methods from main in required sequence
Step 4: Run and Validate
Helpful Tips:
1. Create a separate function for every functionality
2. Add comments wherever applicable and useful
References: Coding Best Practices for Beginner - https://www.ibm.com/developerworks/library/j-perry-writing-good-java-code/index.html
____________________________________________________________________
Today we will learn:
1. What is a properties file
2. How to create a properties file
3. How to get data from properties file
4. How to set data to properties file
5. Run test using Properties file
helpful tips
_______________________________________________
How to get data from properties file
----------------------------------------------------------
STEP 1: Create a object of class Properties class
Properties prop = new Properties();
STEP 2 : Create a object of class InputStream
InputStream input = new FileInputStream("location of properties file");
STEP 2 : Load Properties file
prop.load(input);
STEP 4 : Get values from Properties file
prop.getProperty("browser");
---------------------------------------------------------------
How to set data to properties file
----------------------------------------------------
STEP 1 : Create a object of class Properties class
Properties prop = new Properties();
STEP 2 : Create a object of class OutputStream
OutputStream output = new FileOutputStream("location of properties file");
STEP 3 : Set values
prop.setProperty("result", "pass");
STEP 4 : Store values in properties file
prop.store(output, "comments");
_______________________________________________
References - https://en.wikipedia.org/wiki/.properties
Today we will learn:
1. How to create a runnable JAR
2. How to run the test from command line
-----------------------------------------------------------------
STEP 1 : Create a runnable jar from eclipse project
STEP 2 : Run the jar file from command line
java -jar name.jar
References:
Java Beginner Tutorial 7 - JAR (Java Archive) basics -https://www.youtube.com/watch?v=QB19Wqimkq4&index=7&t=422s&list=PLhW3qG5bs-L_qj1L5hnHvJYeFpQ_g4UuU
Java Decompiler - http://jd.benow.ca/
_____________________________________________________
Today we will learn:
1. What are Headless Browsers
2. Why should we use Headless Browsers
3. When should we NOT use Headless Browsers
4. Examples of Headless Browsers
helpful tips
Html Unit browser
PhantomJS
TrifleJS
SlimmerJS
ZombieJS
Chrome Headless browser
References:
Headless Browsers list - https://gist.github.com/evandrix/3694955
Xvfb wikipedia - https://en.wikipedia.org/wiki/Xvfb
Xvfb Jenkins Plugin - https://wiki.jenkins-ci.org/display/JENKINS/Xvfb+Plugin
Stack Overflow - http://stackoverflow.com/questions/31848410/selenium-test-execution-via-jenkins-on-linux-machine-without-gui-cli-only-he
_____________________________________________________________
Pre-requisites - Selenium jars should be added to the project.
This is covered in the earlier session on this series. Lecture 5 - How to write first Selenium script (java) - 5 Easy Steps
Today we will learn :
1. What is HtmlUnit Driver
2. How to run test with HtmlUnit Driver
HtmlUnitDriver driver = new HtmlUnitDriver();
driver.get("http://seleniumhq.org/");
3. How to emulate other browsers
HtmlUnitDriver driver = new HtmlUnitDriver ( BrowserVersion.CHROME );
_______________________________________________________________
Helpful Tips:
-------------------
How to confirm and validate that your test ran on some specific browser
WebClient webClient = (WebClient) get(driver, "webClient");
private static Object get(Object object, String field) throws Exception {
Field f = object.getClass().getDeclaredField(field);
f.setAccessible(true);
return f.get(object);
}
_______________________________________________________________
Interview Section:
----------------------------
Q. What is HtmlUnit Driver technically in Selenium library.
_______________________________________________________________
References:
HtmlUnit Browser - https://en.wikipedia.org/wiki/HtmlUnit
HtmlUnit Driver - https://github.com/SeleniumHQ/selenium/wiki/HtmlUnitDriver
HtmlUnitDriver documentation - http://seleniumhq.github.io/htmlunit-driver/org/openqa/selenium/htmlunit/HtmlUnitDriver.html#HtmlUnitDriver-com.gargoylesoftware.htmlunit.BrowserVersion-
Webdriver documentation - http://seleniumhq.github.io/selenium/docs/api/java/
___________________________________________________________________
Recommended - also watch next video - How Selenium interacts with PhantomJS
Today we will learn
1. How to download PhantomJS
2. How to add in selenium project
3. How to run selenium test on PhantomJS
How to download PhantomJS
Step 1
Download phantomJS for your OS
http://phantomjs.org/download.html
Step 2 (optional)
Download PhantomJS Driver
Not Required with latest PhantomJS
https://mvnrepository.com/artifact/com.codeborne/phantomjsdriver/1.4.1
(The latest release of PhatomJS has Ghost Driver integrated and there is no need to install it separately.)
-----------------------------------------------------------------------------------------------
How to run Selenium Test on PhantomJS
Step 1
Set system property - phantomjs.binary.path
System.setProperty("phantomjs.binary.path", "location of phantomjs exe");
Step 2
Create object for PhantomJSDriver class
WebDriver driver = new PhantomJSDriver();
Step 3
Create and Run the Test
-----------------------------------------------------------------------------------------------
Recommended : watch earlier video - How to use PhantomJS (Headless Browser)
Today we will learn :
1. What is PhantomJS
2. How Selenium interacts with PhantomJS
helpful tips
interview section..
Pros and Cons of PhantomJS
--------------------------------------------------------------------------------------------
1
What is PhantomJS
PhantomJS is an open source Headless Browser.
(It is a web browser without graphical user interface)
It is a full web stack - that means it can do everything that you can do with Chrome, Safari etc.
It is build over WebKit - an open source web browser engine
http://phantomjs.org/
https://en.wikipedia.org/wiki/PhantomJS
https://webkit.org/
--------------------------------------------------------------------------------------------
2
How Selenium interacts with PhantomJS
GhostDriver
TestRunner to run selenium tests on PhantomJS browser
http://phantomjs.org/headless-testing.html
--------------------------------------------------------------------------------------------
References:
http://seleniumhq.github.io/selenium/docs/api/java/
http://www.seleniumhq.org/download/
https://github.com/detro/ghostdriver
http://cdn.ivandemarino.me/phantomjsdriver-javadoc/index.html
______________________________________________________
In this basic Selenium course we will go very basic, Step by Step and learn Selenium from scratch.
If you are new to Selenium or want to understand the basics, this course is for you.
Every video has notes in description to make it very easy to follow, understand and do hands-on.
Will understand what is Selenium, learn about its components and history and then start using Selenium Web Driver to create test automation scripts.
This is going to be easy and fun.
LET'S GET STARTED