• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction to Selenium
 

Introduction to Selenium

on

  • 10,393 views

This is a quick introduction to the Selenium Test Automation tool.

This is a quick introduction to the Selenium Test Automation tool.

Statistics

Views

Total Views
10,393
Views on SlideShare
10,328
Embed Views
65

Actions

Likes
4
Downloads
344
Comments
1

4 Embeds 65

http://www.techgig.com 25
http://www.slideshare.net 20
http://reddyphp.wordpress.com 19
http://115.112.206.131 1

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction to Selenium Introduction to Selenium Presentation Transcript

    • Selenium Web Test Automation Tool Rohit Nayak Talentica Software
    • Agenda
      • Demo
      • What is Selenium? Why? Pros/Cons
      • Writing test cases using Selenium
      • Architecture
      • Best Practices
    • Demo
      • Record a test in Selenium IDE
      • Review test in Selenese HTML
    • Similar Tools
      • Bad Boy
      • Sahi
      • Silk Test, QTP (paid)
      • Grinder
      • Others: Watir, OpenSTA
    • What is Selenium?
      • Test tool for web applications
      • Actually runs in a browser
      • Supports tests in many languages
      • Selenese (pure HTML, no backend required)
      • Java, C#, Perl, Python, Ruby
      • Record/playback (Firefox plugin: Selenium IDE)
      • Open Source with corporate backing
      • Lives at selenium.org
    • Advantages
      • Free!
      • Can test across multiple browsers
      • Mimics actual user experience
      • Ajax / CSS support
      • Use language of choice
      • Large user community
      • Great tools: CubicTest, Grid, HRMES
    • Common Problems in Web Testing
      • Record/replay is not reusable, is fragile
      • Managing test cases
      • UI Changes make tests brittle
    • Problems
      • Performance (~HTMLUnit, WebTest)
      • Reporting (~WebTest)
      • Fancy CSS/Ajax needs tricky coding
      • Data dependency should be avoided
    • Best Practices
      • All tests should be source control
      • One test per function not per page
      • Nightly runs
      • Separate environ specific variables
      • Automate fixed function, others manual
      • Abstract out functionality and reuse them
      • Parameterize your tests
      • Framework!!
    • Code for testability
      • Demand this from Development
      • Visible feedback on actions (hidden values in case div appears/disappears)
      • (dev-only) url for database teardown
      • Use of IDs for important UI elements
      • Good HTML
      • Good logs
    • Demo 2
      • Show same test written in Java
      • Show same test written in PHP
    • Java Example
      • public void testGoogleTestSearch()
      • throws Exception
      • {
        • selenium.open("http://www.google.com/webhp");
        • assertEquals("Google", selenium.getTitle());
        • selenium.type("q", "Selenium OpenQA");
        • selenium.click("btnG");
        • selenium.waitForPageToLoad("5000");
        • assertEquals("Selenium OpenQA - Google Search",
        • selenium.getTitle());
      • }
    • JUnit
      • public void setUp() throws Exception
      • {
        • selenium = new DefaultSelenium(
        • "localhost", 4444, "*chrome", "http://www.google.com");
        • selenium.start();
      • }
      • public void tearDown() throws Exception
      • {
      • selenium.stop();
      • }
    • Some Selenese Commands submit type isTextPresent createCookie isElementPresent fireEvent dragdrop open goBack Input mouseOver storeText assertSelected keyPress getTitle isVisible waitForCondition click
    • Element locators
      • ID: id=foo
      • Name: name=foo
      • First ID, then name: identifier=foo
      • DOM: document.forms[‘myform’].myDropdown
      • XPath: xpath=//table[@id='table1']//tr[4]/td[2]
      • Link Text: link=sometext
      • Sensible defaults, e.g. xpath if starts with //
    • Selenium Modules
      • Selenium Core
      • Selenium IDE
      • Selenium Remote Control
      • Client Drivers
      • JS Extensions
    • How it works
    • Selenium Usage Patterns
      • Creating Tests
      • Recording using Selenium IDE
      • Writing tests in Selenese
      • Building a Framework
      • Running Tests
      • Through IDE
      • Using Selenium RC
      • Using Framework
    • Advanced
      • Cubic Test
      • HRMES
      • Selenium Grid
      • BrowserMob
      • Tellurium