SlideShare a Scribd company logo
1 of 21
Selenium IDE
Selenium WebDriver
Automated TestingTool
1
Selenium developed in 2004 by Jason Huggins as a JavaScript library used to
automate his manual testing routines
In 2005 Dan Fabulich and Nelson Sproul (with help from Pat Lightbody)
made an offer to accept a series of patches that would transform Selenium-RC into
what it became best known for. In the same meeting, the steering of Selenium as a
project would continue as a committee, with Huggins and Hammant being the
ThoughtWorks representatives.
In 2007, Huggins joined Google.Together with others like Jennifer Bevan, he
continued with the development and stabilization of Selenium RC. At the same time,
Simon Stewart atThoughtWorks developed a superior browser automation tool called
WebDriver.
In 2009, after a meeting between the developers at the GoogleTest
Automation Conference, it was decided to merge the two projects, and call the new
project SeleniumWebDriver, or Selenium 2.0.
2
Selenium is a suite of testing automation tools used forWeb-Base
applications: Selenium IDE, Selenium RC, Selenium WebDriver and Selenium Grid
These tools provide a rich set of testing functions specifically geared to
varied testing scenarios of all types of Web applications
The operations provided by these tools are highly flexible and afford many
options for comparing UI elements to expected application behavior
Selenium tests can be executed on multiple browser platforms
3
Selenium IDE
Rapid prototyping tool for building test scripts
Firefox plugin
Can be used by developers with little to no programming experience to write
simple tests quickly and gain familiarity with the Selenese commands
Has a recording feature that records a user’s live actions that can be exported in
one of many programming languages
Does not provide iteration or conditional statements for test scripts
Developed tests can be run against other browsers, using a simple command-line
interface that invokes the Selenium RC server
Can exportWebDriver or Remote Control scripts (these scripts should be in
PageObject structure)
Allows you the option to select a language for saving and displaying test cases
4
Firefox extension
Easy record and playback
Not just a recorder
Intelligent field selection will
use IDs, names, or XPath as needed
Auto-complete for all common Selenium commands
Debug and set breakpoints
Save tests as HTML, Ruby scripts,
or any other format
5
 Action
▪ Manipulate the state of the application
▪ Used with “AndWait” (clickAndWait)
 Accessors
▪ Examines the application state and stores the results in variables
▪ Used to auto generate Assertions
 Assertions
▪ Similar to Accessors but verifies the state of the application to what is
expected
▪ Modes: assert, verify and waitFor
6
 AndWait
▪ Tells Selenium to wait for the page to load after an action has been
performed
▪ Used when triggering navigation/page refresh (test will fail otherwise)
▪ Command: clickAndWait
 WaitFor
▪ No set time period
▪ Dynamically waits for the desired condition, checking every second
▪ Commands: waitForElementPresent, waitForVisible, etc…
 Echo
▪ Used to display information progress notes that is displayed to the console
during test execution
▪ Informational notes can be used to provide context within your test results
report
▪ Used to print the contents of Selenium variables
7
Commonly Used Selenium Commands
 open
 click/clickAndWait
 verifyTitle/assertTitle
 verifyTextPresent
 verifyElementPresent
 verifyText
 verifyTable
 waitForPageToLoad
 waitForElementPresent
8
 By Identifier
▪ Used by default
▪ Locator type is “identifier”
▪ First element with id attribute value matching the location will be used
▪ First element with a name attribute matching the location will be used if
there are no id matches
 By ID
▪ More limited than the “identifier” type
▪ Locator type is “id”
▪ Use this type when you know the element’s id
 By Name
▪ Locates an element with a matching name attribute
▪ Filters can be applied for elements with the same name attribute
▪ Locator type is “name”
9
 X-Path
▪ Used for locating nodes in an XML document
▪ Elements can be located in regards to absolute terms or a relative
position to an element that has a specified id or name attribute
▪ Can locate elements via attributes other than id or name
▪ Starts with “//”
 By DOM
▪ Can be accessed using Javascript
▪ Locator type is “document”
 By CSS
▪ Uses the style binding of selectors to elements in a document as a
locating strategy
▪ Faster than X-Path and can find the most complicated objects in an
intrinsic HTML document
▪ Locator type is “css”
10
SeleniumWebDriver is the successor to Selenium RC. SeleniumWebDriver
accepts commands (sent in Selenese, or via a Client API) and sends them to a browser.
This is implemented through a browser-specific browser driver, which sends
commands to a browser, and retrieves results. Most browser drivers actually launch
and access a browser application (such as Firefox or Internet Explorer); there is also an
HtmlUnit browser driver, which simulates a browser using HtmlUnit.
Selenium-WebDriver supports multiple browsers in multiple platforms
 Google Chrome 12.0.712.0+
 Internet Explorer 6+
 Firefox 3.0+
 Opera 11.5+
 Android – 2.3+ for phones and tablets
 iOS 3+ for phones
 iOS 3.2+ for tablets
11
WebDriver is designed to providing a simpler and uniformed programming
interface
▪ SameWebDriver script runs for different platforms
Support multiple programming language:
▪ Java, C#, Python, Ruby, PHP, Perl…
It’s efficient
▪ WebDriver leverages each browser’s native support for automation.
A solution for the automated testing
▪ Simulate user actions
▪ Functional testing
Create regression tests to verify functionality and user acceptance.
▪ Browser compatibility testing
The same script can run on any Selenium platform
▪ Load testing
▪ Stress testing
12
public static void main( String[] args ) {
// Create a new instance of the Firefox driver
WebDriver driver = new FirefoxDriver();
// (1) Go to a page
driver.get("http://www.google.com");
// (2) Locate an element
WebElement element = driver.findElement(By.name("q"));
// (3-1) Enter something to search for
element.sendKeys("Purdue Univeristy");
// (3-2) Now submit the form. WebDriver will find the form for us from the element
element.submit();
// (3-3) Wait up to 10 seconds for a condition
WebDriverWait waiting = newWebDriverWait(driver, 10);
waiting.until( ExpectedConditions.presenceOfElementLocated( By.id("pnnext") ) );
// (4) Check the title of the page
if( driver.getTitle().equals("purdue univeristy - Google Search") )
System.out.println("PASS");
else
System.err.println("FAIL");
//Close the browser
driver.quit();
}
13
 By id
 HTML: <div id="coolestWidgetEvah">...</div>
 WebDriver:
driver.findElement( By.id("coolestWidgetEvah") );
 By name
 HTML: <input name="cheese" type="text"/>
 WebDriver:
driver.findElement( By.name("cheese") );
 By Xpath
 HTML
<html>
<input type="text" name="example" />
<input type="text" name="other" />
</html>
 WebDriver:
driver.findElements( By.xpath("//input") );
14
Creating New Instance Of Firefox Driver
WebDriver driver = new FirefoxDriver();
CommandTo Open URL In Browser
driver.get(“http://google.com");
Clicking on any element or button of webpage
driver.findElement(By.id("submitButton")).click();
Retrieve text from targeted element of software web application page and will
store it in variable = dropdown
String dropdown=driver.findElement(By.tagName("select")).getText;
Typing text in text box or text area.
driver.findElement(By.name("fname")).sendKeys("My First Name");
Applying Implicit wait in webdriver
driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS);
15
Get page title in selenium webdriver
driver.getTitle();
Get Current Page URL In SeleniumWebDriver
driver.getCurrentUrl();
Selecting or Deselecting value from drop down in selenium webdriver.
Select ByVisibleText
Select mydrpdwn = new Select(driver.findElement(By.id("Carlist")));
mydrpdwn.selectByVisibleText("Audi");
Select ByValue
Select listbox = new
Select(driver.findElement(By.xpath("//select[@name='FromLB']")));
listbox.selectByValue("Italy")
Select By Index
Select listbox = new
Select(driver.findElement(By.xpath("//select[@name='FromLB']")));
listbox.selectByIndex(0);
16
Get page title in selenium webdriver
driver.getTitle();
Get Current Page URL In SeleniumWebDriver
driver.getCurrentUrl();
Selecting or Deselecting value from drop down in selenium webdriver.
Select ByVisibleText
Select mydrpdwn = new Select(driver.findElement(By.id("Carlist")));
mydrpdwn.selectByVisibleText("Audi");
Select ByValue
Select listbox = new
Select(driver.findElement(By.xpath("//select[@name='FromLB']")));
listbox.selectByValue("Italy")
Select By Index
Select listbox = new
Select(driver.findElement(By.xpath("//select[@name='FromLB']")));
listbox.selectByIndex(0);
17
Navigate to URL or Back or Forward in SeleniumWebdriver
driver.navigate().to("http://google.com");
driver.navigate().back();
driver.navigate().forward();
Verify Element Present in SeleniumWebDriver
Boolean iselementpresent =
driver.findElements(By.xpath("//input[@id='text2']")).size()!= 0;
Capturing entire page screenshot in SeleniumWebDriver
File screenshot =
((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(screenshot, new File("D:screenshot.jpg"));
18
assertEquals
Assert.assertEquals(actual, expected);
AssertEquals assertion helps you to assert actual and expected equal values.
assertNotEquals
Assert.assertNotEquals(actual, expected);
assertNotEquals assertion is useful to assert not equal values.
assertTrue
Assert.assertTrue(condition);
assertTrue assertion works for boolean value true assertion.
assertFalse
Assert.assertFalse(condition);
assertFalse assertion works for boolean value false assertion.
19
Selenium IDE
Advantages
Selenium IDE is very easy to use.
It has the capability to convert the test to different programming languages such as html,
java etc
Programming language experience is not required for Selenium IDE
Selenium IDE provides Logging capabilities using file login plug-in.
In Selenium IDE, user can debug and set breakpoints
Selenium IDE is flexible for the users.
Disadvantage
Selenium IDE is Firefox plugin, thus its support is limited to Firefox only
It will not support iteration and conditional statement
Selenium IDE doesn't support error handling
Doesn't support test script grouping
Selenium IDE do not support Database testing
20
Selenium WebDriver
Advantages
Support for iPhone and Android testing
Better features for Ajax testing.
You can easily simulate clicking on front and back button of browser.
Unlike RC you dont have to start a server in webdriver.
You can simulate movement of a mouse using selenium.
You can find coordinates of any object usingWebdriver.
You have classes inWebdriver which help you to simulate key press events of keyboard.
Keywod driven framework is very easy to build in webdriver.
Disadvantages
WebDriver needs very much expertise resources.The resource should also be very well
versed in framework architecture.
It is difficult to test Image based application.
WebDriver need outside support for report generation activity like dependence on TestNG
or Jenkins
WebDriver does not support file upload facility.
21

More Related Content

What's hot

Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesVijay Rangaiah
 
Webinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation UncomplicatedWebinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation UncomplicatedEdureka!
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using SeleniumNaresh Chintalcheru
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Seleniumvivek_prahlad
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Edureka!
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introductionPankaj Dubey
 
Introduction to Automation Testing and Selenium overiew
Introduction to Automation Testing and Selenium overiewIntroduction to Automation Testing and Selenium overiew
Introduction to Automation Testing and Selenium overiewDisha Srivastava
 
Selenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | EdurekaSelenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | EdurekaEdureka!
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.pptAna Sarbescu
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverPankaj Biswas
 
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...Simplilearn
 

What's hot (20)

Selenium Presentation at Engineering Colleges
Selenium Presentation at Engineering CollegesSelenium Presentation at Engineering Colleges
Selenium Presentation at Engineering Colleges
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Webinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation UncomplicatedWebinar: Selenium WebDriver - Automation Uncomplicated
Webinar: Selenium WebDriver - Automation Uncomplicated
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
 
Selenium
SeleniumSelenium
Selenium
 
Selenium introduction
Selenium introductionSelenium introduction
Selenium introduction
 
Introduction to Automation Testing and Selenium overiew
Introduction to Automation Testing and Selenium overiewIntroduction to Automation Testing and Selenium overiew
Introduction to Automation Testing and Selenium overiew
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | EdurekaSelenium Maven With Eclipse | Edureka
Selenium Maven With Eclipse | Edureka
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
 
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 

Viewers also liked

Selenium documentation,
Selenium documentation,Selenium documentation,
Selenium documentation,t7t7uyt
 
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...Iakiv Kramarenko
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Controlusha kannappan
 

Viewers also liked (6)

Selenium documentation,
Selenium documentation,Selenium documentation,
Selenium documentation,
 
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
Selenide Alternative in Practice - Implementation & Lessons learned [Selenium...
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 
Basics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote ControlBasics of Selenium IDE,Core, Remote Control
Basics of Selenium IDE,Core, Remote Control
 
Selenium
SeleniumSelenium
Selenium
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 

Similar to Selenium web driver

Selenium Basics by Quontra Solutions
Selenium Basics by Quontra SolutionsSelenium Basics by Quontra Solutions
Selenium Basics by Quontra SolutionsQUONTRASOLUTIONS
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaEr. Sndp Srda
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using JavaF K
 
Selenium for Tester.pdf
Selenium for Tester.pdfSelenium for Tester.pdf
Selenium for Tester.pdfRTechRInfoIT
 
Get Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 GridGet Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 GridDaniel Herken
 
Selenium Commands (Short Interview Preparation)
Selenium Commands (Short Interview Preparation)Selenium Commands (Short Interview Preparation)
Selenium Commands (Short Interview Preparation)Yogesh Thalkari
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Puneet Kala
 

Similar to Selenium web driver (20)

Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
 
Selenium
SeleniumSelenium
Selenium
 
Selenium Basics by Quontra Solutions
Selenium Basics by Quontra SolutionsSelenium Basics by Quontra Solutions
Selenium Basics by Quontra Solutions
 
Selenium
SeleniumSelenium
Selenium
 
Selenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep ShardaSelenium Introduction by Sandeep Sharda
Selenium Introduction by Sandeep Sharda
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
 
Selenium for Tester.pdf
Selenium for Tester.pdfSelenium for Tester.pdf
Selenium for Tester.pdf
 
Get Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 GridGet Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 Grid
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium Commands (Short Interview Preparation)
Selenium Commands (Short Interview Preparation)Selenium Commands (Short Interview Preparation)
Selenium Commands (Short Interview Preparation)
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
 

Recently uploaded

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Recently uploaded (20)

FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Selenium web driver

  • 2. Selenium developed in 2004 by Jason Huggins as a JavaScript library used to automate his manual testing routines In 2005 Dan Fabulich and Nelson Sproul (with help from Pat Lightbody) made an offer to accept a series of patches that would transform Selenium-RC into what it became best known for. In the same meeting, the steering of Selenium as a project would continue as a committee, with Huggins and Hammant being the ThoughtWorks representatives. In 2007, Huggins joined Google.Together with others like Jennifer Bevan, he continued with the development and stabilization of Selenium RC. At the same time, Simon Stewart atThoughtWorks developed a superior browser automation tool called WebDriver. In 2009, after a meeting between the developers at the GoogleTest Automation Conference, it was decided to merge the two projects, and call the new project SeleniumWebDriver, or Selenium 2.0. 2
  • 3. Selenium is a suite of testing automation tools used forWeb-Base applications: Selenium IDE, Selenium RC, Selenium WebDriver and Selenium Grid These tools provide a rich set of testing functions specifically geared to varied testing scenarios of all types of Web applications The operations provided by these tools are highly flexible and afford many options for comparing UI elements to expected application behavior Selenium tests can be executed on multiple browser platforms 3
  • 4. Selenium IDE Rapid prototyping tool for building test scripts Firefox plugin Can be used by developers with little to no programming experience to write simple tests quickly and gain familiarity with the Selenese commands Has a recording feature that records a user’s live actions that can be exported in one of many programming languages Does not provide iteration or conditional statements for test scripts Developed tests can be run against other browsers, using a simple command-line interface that invokes the Selenium RC server Can exportWebDriver or Remote Control scripts (these scripts should be in PageObject structure) Allows you the option to select a language for saving and displaying test cases 4
  • 5. Firefox extension Easy record and playback Not just a recorder Intelligent field selection will use IDs, names, or XPath as needed Auto-complete for all common Selenium commands Debug and set breakpoints Save tests as HTML, Ruby scripts, or any other format 5
  • 6.  Action ▪ Manipulate the state of the application ▪ Used with “AndWait” (clickAndWait)  Accessors ▪ Examines the application state and stores the results in variables ▪ Used to auto generate Assertions  Assertions ▪ Similar to Accessors but verifies the state of the application to what is expected ▪ Modes: assert, verify and waitFor 6
  • 7.  AndWait ▪ Tells Selenium to wait for the page to load after an action has been performed ▪ Used when triggering navigation/page refresh (test will fail otherwise) ▪ Command: clickAndWait  WaitFor ▪ No set time period ▪ Dynamically waits for the desired condition, checking every second ▪ Commands: waitForElementPresent, waitForVisible, etc…  Echo ▪ Used to display information progress notes that is displayed to the console during test execution ▪ Informational notes can be used to provide context within your test results report ▪ Used to print the contents of Selenium variables 7
  • 8. Commonly Used Selenium Commands  open  click/clickAndWait  verifyTitle/assertTitle  verifyTextPresent  verifyElementPresent  verifyText  verifyTable  waitForPageToLoad  waitForElementPresent 8
  • 9.  By Identifier ▪ Used by default ▪ Locator type is “identifier” ▪ First element with id attribute value matching the location will be used ▪ First element with a name attribute matching the location will be used if there are no id matches  By ID ▪ More limited than the “identifier” type ▪ Locator type is “id” ▪ Use this type when you know the element’s id  By Name ▪ Locates an element with a matching name attribute ▪ Filters can be applied for elements with the same name attribute ▪ Locator type is “name” 9
  • 10.  X-Path ▪ Used for locating nodes in an XML document ▪ Elements can be located in regards to absolute terms or a relative position to an element that has a specified id or name attribute ▪ Can locate elements via attributes other than id or name ▪ Starts with “//”  By DOM ▪ Can be accessed using Javascript ▪ Locator type is “document”  By CSS ▪ Uses the style binding of selectors to elements in a document as a locating strategy ▪ Faster than X-Path and can find the most complicated objects in an intrinsic HTML document ▪ Locator type is “css” 10
  • 11. SeleniumWebDriver is the successor to Selenium RC. SeleniumWebDriver accepts commands (sent in Selenese, or via a Client API) and sends them to a browser. This is implemented through a browser-specific browser driver, which sends commands to a browser, and retrieves results. Most browser drivers actually launch and access a browser application (such as Firefox or Internet Explorer); there is also an HtmlUnit browser driver, which simulates a browser using HtmlUnit. Selenium-WebDriver supports multiple browsers in multiple platforms  Google Chrome 12.0.712.0+  Internet Explorer 6+  Firefox 3.0+  Opera 11.5+  Android – 2.3+ for phones and tablets  iOS 3+ for phones  iOS 3.2+ for tablets 11
  • 12. WebDriver is designed to providing a simpler and uniformed programming interface ▪ SameWebDriver script runs for different platforms Support multiple programming language: ▪ Java, C#, Python, Ruby, PHP, Perl… It’s efficient ▪ WebDriver leverages each browser’s native support for automation. A solution for the automated testing ▪ Simulate user actions ▪ Functional testing Create regression tests to verify functionality and user acceptance. ▪ Browser compatibility testing The same script can run on any Selenium platform ▪ Load testing ▪ Stress testing 12
  • 13. public static void main( String[] args ) { // Create a new instance of the Firefox driver WebDriver driver = new FirefoxDriver(); // (1) Go to a page driver.get("http://www.google.com"); // (2) Locate an element WebElement element = driver.findElement(By.name("q")); // (3-1) Enter something to search for element.sendKeys("Purdue Univeristy"); // (3-2) Now submit the form. WebDriver will find the form for us from the element element.submit(); // (3-3) Wait up to 10 seconds for a condition WebDriverWait waiting = newWebDriverWait(driver, 10); waiting.until( ExpectedConditions.presenceOfElementLocated( By.id("pnnext") ) ); // (4) Check the title of the page if( driver.getTitle().equals("purdue univeristy - Google Search") ) System.out.println("PASS"); else System.err.println("FAIL"); //Close the browser driver.quit(); } 13
  • 14.  By id  HTML: <div id="coolestWidgetEvah">...</div>  WebDriver: driver.findElement( By.id("coolestWidgetEvah") );  By name  HTML: <input name="cheese" type="text"/>  WebDriver: driver.findElement( By.name("cheese") );  By Xpath  HTML <html> <input type="text" name="example" /> <input type="text" name="other" /> </html>  WebDriver: driver.findElements( By.xpath("//input") ); 14
  • 15. Creating New Instance Of Firefox Driver WebDriver driver = new FirefoxDriver(); CommandTo Open URL In Browser driver.get(“http://google.com"); Clicking on any element or button of webpage driver.findElement(By.id("submitButton")).click(); Retrieve text from targeted element of software web application page and will store it in variable = dropdown String dropdown=driver.findElement(By.tagName("select")).getText; Typing text in text box or text area. driver.findElement(By.name("fname")).sendKeys("My First Name"); Applying Implicit wait in webdriver driver.manage().timeouts().implicitlyWait(15,TimeUnit.SECONDS); 15
  • 16. Get page title in selenium webdriver driver.getTitle(); Get Current Page URL In SeleniumWebDriver driver.getCurrentUrl(); Selecting or Deselecting value from drop down in selenium webdriver. Select ByVisibleText Select mydrpdwn = new Select(driver.findElement(By.id("Carlist"))); mydrpdwn.selectByVisibleText("Audi"); Select ByValue Select listbox = new Select(driver.findElement(By.xpath("//select[@name='FromLB']"))); listbox.selectByValue("Italy") Select By Index Select listbox = new Select(driver.findElement(By.xpath("//select[@name='FromLB']"))); listbox.selectByIndex(0); 16
  • 17. Get page title in selenium webdriver driver.getTitle(); Get Current Page URL In SeleniumWebDriver driver.getCurrentUrl(); Selecting or Deselecting value from drop down in selenium webdriver. Select ByVisibleText Select mydrpdwn = new Select(driver.findElement(By.id("Carlist"))); mydrpdwn.selectByVisibleText("Audi"); Select ByValue Select listbox = new Select(driver.findElement(By.xpath("//select[@name='FromLB']"))); listbox.selectByValue("Italy") Select By Index Select listbox = new Select(driver.findElement(By.xpath("//select[@name='FromLB']"))); listbox.selectByIndex(0); 17
  • 18. Navigate to URL or Back or Forward in SeleniumWebdriver driver.navigate().to("http://google.com"); driver.navigate().back(); driver.navigate().forward(); Verify Element Present in SeleniumWebDriver Boolean iselementpresent = driver.findElements(By.xpath("//input[@id='text2']")).size()!= 0; Capturing entire page screenshot in SeleniumWebDriver File screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); FileUtils.copyFile(screenshot, new File("D:screenshot.jpg")); 18
  • 19. assertEquals Assert.assertEquals(actual, expected); AssertEquals assertion helps you to assert actual and expected equal values. assertNotEquals Assert.assertNotEquals(actual, expected); assertNotEquals assertion is useful to assert not equal values. assertTrue Assert.assertTrue(condition); assertTrue assertion works for boolean value true assertion. assertFalse Assert.assertFalse(condition); assertFalse assertion works for boolean value false assertion. 19
  • 20. Selenium IDE Advantages Selenium IDE is very easy to use. It has the capability to convert the test to different programming languages such as html, java etc Programming language experience is not required for Selenium IDE Selenium IDE provides Logging capabilities using file login plug-in. In Selenium IDE, user can debug and set breakpoints Selenium IDE is flexible for the users. Disadvantage Selenium IDE is Firefox plugin, thus its support is limited to Firefox only It will not support iteration and conditional statement Selenium IDE doesn't support error handling Doesn't support test script grouping Selenium IDE do not support Database testing 20
  • 21. Selenium WebDriver Advantages Support for iPhone and Android testing Better features for Ajax testing. You can easily simulate clicking on front and back button of browser. Unlike RC you dont have to start a server in webdriver. You can simulate movement of a mouse using selenium. You can find coordinates of any object usingWebdriver. You have classes inWebdriver which help you to simulate key press events of keyboard. Keywod driven framework is very easy to build in webdriver. Disadvantages WebDriver needs very much expertise resources.The resource should also be very well versed in framework architecture. It is difficult to test Image based application. WebDriver need outside support for report generation activity like dependence on TestNG or Jenkins WebDriver does not support file upload facility. 21