ºÝºÝߣ

ºÝºÝߣShare a Scribd company logo
Welcome



          June 21, 2012   1
Presentation on
Selenium-Webdriver


   Browser automation
About SCQAA-SF- A Not-for Profit
Organization

• SCQAA-SF (www.scqaa.net) chapter
    sponsors the sharing of information to
    promote and encourage the improvement in
    information technology quality practices and
    principles through networking, training and
    professional development.
•   Networking: We meet once in 2 months in
    San Fernando Valley.
•   Check us out on LinkedIn (SCQAA-SF)
•   Contact Sujit at sujit58@gmail.com or call
                                       June 21, 2012   3
Membership Benefits:
• Excellent speaker presentations on
    advancements in technology and
    methodology
•   Networking opportunities
•   PDU, CSTE and CSQA credits
•   Regular meetings are free for members and
    include dinner



                                       June 21, 2012   4
Membership Policy
• Recently revised our membership dues policy
    to better accommodate member needs and
    current economic conditions.
•   Annual membership is $50, or $35 for those
    who are in between jobs.
•   Please check your renewal with Cheryl Leoni.
    If you have recently joined or renewed,
    please check before renewing again


                                     June 21, 2012   5
What is Selenium?
Browser automation tool
•   Open source
•   Works with multiple OS, and browsers.
•   Selenium IDE is a plugin that can be
    installed to record and run tests.
•   Selenium provides an API,and libraries to
    support following languages- Java, Ruby,
    Python, PHP, Perl, and C#.
Components




WebDriver                          GRID

                      CORE API




   IDE                           Selenium RC
Build architecture
                     REPORT


                                       SELENIUM GRID



ddDEVELOPER


                       JENKINS                    CH
                                      IE    FF    RO
                                      9           ME

                     BUILD SERVER
                                    MUMULTIPLE NODES

     SVN



                                           AUT
 RRREPOSITORY

                     QA ENGINEER
DOM and locating UI Elements
The Document Object Model (DOM) is an application programming
interface (API) for valid HTML and well-formed XML documents. It defines
the logical structure of documents and the way a document is accessed
and manipulated.




     Most common locators while traversing DOM
      •   By ID

      •   By Class Name

      •   By Tag Name

      •   By Link Text

      •   By CSS

      •   By By XPATH
import static org.junit.Assert.assertEquals;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;                            webDriver Import


public class NewTest {

                                                                               Java
  public static void main(String[] args) {

  WebDriver d= new FirefoxDriver();
  d.get("http://www.altavista.com/");
  d.findElement(By.id("yschsp")).sendKeys("water");
  d.findElement(By.id("yschbt")).click();                                       WebDriver codes

  d.findElement(By.id("link-1")).click();

  System.out.println("Title contains"+" " +d.getTitle());
  assertEquals("Water - Wikipedia, the free encyclopedia",(d.getTitle()));
  d.close();


                                                                                      Junit Annotation



  }
R               RESOURCES

WebDriver Link
http://seleniumhq.org/docs/03_webdriver.htm



Firebug link              http://getfirebug.com/




Eclipse download         http://www.eclipse.org/downloads/
://www.eclipse.org/downloads/
http://www.eclipse.org/downloads/
Thank you so much for attending the presentation. If you have any
questions do not hesitate to-

Contact the Presenter:

Sajan at srimal27@hotmail.com

Sujit Ghosh, Program Chair at SCQAA at sujit58@gmail.com

More Related Content

SCQAA-SF Selenium Presentation

  • 1. Welcome June 21, 2012 1
  • 3. About SCQAA-SF- A Not-for Profit Organization • SCQAA-SF (www.scqaa.net) chapter sponsors the sharing of information to promote and encourage the improvement in information technology quality practices and principles through networking, training and professional development. • Networking: We meet once in 2 months in San Fernando Valley. • Check us out on LinkedIn (SCQAA-SF) • Contact Sujit at sujit58@gmail.com or call June 21, 2012 3
  • 4. Membership Benefits: • Excellent speaker presentations on advancements in technology and methodology • Networking opportunities • PDU, CSTE and CSQA credits • Regular meetings are free for members and include dinner June 21, 2012 4
  • 5. Membership Policy • Recently revised our membership dues policy to better accommodate member needs and current economic conditions. • Annual membership is $50, or $35 for those who are in between jobs. • Please check your renewal with Cheryl Leoni. If you have recently joined or renewed, please check before renewing again June 21, 2012 5
  • 6. What is Selenium? Browser automation tool • Open source • Works with multiple OS, and browsers. • Selenium IDE is a plugin that can be installed to record and run tests. • Selenium provides an API,and libraries to support following languages- Java, Ruby, Python, PHP, Perl, and C#.
  • 7. Components WebDriver GRID CORE API IDE Selenium RC
  • 8. Build architecture REPORT SELENIUM GRID ddDEVELOPER JENKINS CH IE FF RO 9 ME BUILD SERVER MUMULTIPLE NODES SVN AUT RRREPOSITORY QA ENGINEER
  • 9. DOM and locating UI Elements The Document Object Model (DOM) is an application programming interface (API) for valid HTML and well-formed XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated. Most common locators while traversing DOM • By ID • By Class Name • By Tag Name • By Link Text • By CSS • By By XPATH
  • 10. import static org.junit.Assert.assertEquals; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; webDriver Import public class NewTest { Java public static void main(String[] args) { WebDriver d= new FirefoxDriver(); d.get("http://www.altavista.com/"); d.findElement(By.id("yschsp")).sendKeys("water"); d.findElement(By.id("yschbt")).click(); WebDriver codes d.findElement(By.id("link-1")).click(); System.out.println("Title contains"+" " +d.getTitle()); assertEquals("Water - Wikipedia, the free encyclopedia",(d.getTitle())); d.close(); Junit Annotation }
  • 11. R RESOURCES WebDriver Link http://seleniumhq.org/docs/03_webdriver.htm Firebug link http://getfirebug.com/ Eclipse download http://www.eclipse.org/downloads/ ://www.eclipse.org/downloads/ http://www.eclipse.org/downloads/
  • 12. Thank you so much for attending the presentation. If you have any questions do not hesitate to- Contact the Presenter: Sajan at srimal27@hotmail.com Sujit Ghosh, Program Chair at SCQAA at sujit58@gmail.com