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

Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionGanuka Yashantha
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with seleniumTzirla Rozental
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework DesignsSauce Labs
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with SeleniumKerry Buckley
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriverAnuraj S.L
 
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Simplilearn
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introductionRasheed Waraich
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Seleniumvivek_prahlad
 
Web Services and Introduction of SOAPUI
Web Services and Introduction of SOAPUIWeb Services and Introduction of SOAPUI
Web Services and Introduction of SOAPUIDinesh Kaushik
 
Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Edureka!
 

What's hot (20)

Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Hybrid Automation Framework Development introduction
Hybrid Automation Framework Development introductionHybrid Automation Framework Development introduction
Hybrid Automation Framework Development introduction
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
 
Hybrid framework
Hybrid frameworkHybrid framework
Hybrid framework
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
 
Selenium WebDriver FAQ's
Selenium WebDriver FAQ'sSelenium WebDriver FAQ's
Selenium WebDriver FAQ's
 
Selenium
SeleniumSelenium
Selenium
 
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
Selenium IDE Tutorial For Beginners | Selenium IDE Tutorial | What Is Seleniu...
 
SELENIUM PPT.pdf
SELENIUM PPT.pdfSELENIUM PPT.pdf
SELENIUM PPT.pdf
 
Spring boot introduction
Spring boot introductionSpring boot introduction
Spring boot introduction
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Selenium Automation Framework
Selenium Automation  FrameworkSelenium Automation  Framework
Selenium Automation Framework
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Web Services and Introduction of SOAPUI
Web Services and Introduction of SOAPUIWeb Services and Introduction of SOAPUI
Web Services and Introduction of SOAPUI
 
Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
 
POSTMAN.pptx
POSTMAN.pptxPOSTMAN.pptx
POSTMAN.pptx
 

Viewers also liked

Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using SeleniumNaresh Chintalcheru
 
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 (7)

Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
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

Similar to Selenium web driver (20)

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
 
Selenium
SeleniumSelenium
Selenium
 
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
 

Recently uploaded

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 

Recently uploaded (20)

Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The transition to renewables in India.pdf
The transition to renewables in India.pdfThe transition to renewables in India.pdf
The transition to renewables in India.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 

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