Selenium?? - PowerPoint PPT Presentation

1 / 35
About This Presentation
Title:

Selenium??

Description:

Selenium Xu.zhibin_at_Covics * * ... – PowerPoint PPT presentation

Number of Views:353
Avg rating:3.0/5.0
Slides: 36
Provided by: qwolfComu
Category:
Tags: selenium

less

Transcript and Presenter's Notes

Title: Selenium??


1
Selenium??
Xu.zhibin_at_Covics
2
Selenium??
  • Selenium?ThoughtWorks??? Web ?????????????Selenium
    ??JavaScript?Iframes?????????????,???????JavaScrip
    t?????????,???????????????
  • ????????Selenium-IDE, Selenium-Core, Selenium-RC
    ???????????,????,????,????,????,??????????????????
    ?

selenium si'lini?m
3
Selenium??
  • ?????
  • ??,????,????
  • Selenium???????,???????????,??????????????????????
    ??????????????????????,?????????????
  • ??????????? Selenium ????,?????????????????????
    Web ????????,????????????,???? Web ??????????
    Web ????

4
Selenium??
  • ??Selenium IDE ,??FireFox plugin,??????????,??????
    ???????????Selenium Core????,????Selenium
    RC??Java,C,Ruby????????????
  • ????????????(?IE?FireFox)?????????????????Web?????
    ?,????????????????JS???

5
Selenium??
  • Selenium?????? ??(action)???(assertion)
  • ??????? Web ????????
  • ???????(selenium.click(locotar))??(selenium.type
    (locotar,value))????,???????????,??? Selenium
    ???????????
  • ?????????????????????????????????????
  • ?assertEquasl(selenium.getTitle(),QQview)????
    ??title???QQview

6
Selenium??
  • Selenium?????????test runner(selenium-core)?
    driven(selenium-rc)?
  • ????????????????????
  • Driven ????????????????,????????????????????
    Python ? Ruby ???????????,????????????????
  • ??????????????
  • ???? driven ??,??????????????,????? test runner
    ????,??????????????
  • ??? test runner ?? driven ????,?????????????

7
Selenium??
  • Selenium IDE???????????,?Firefox?????,??Firefox?
    ???????????????,???????????????????Selenium
    IDE???????????IDE?????,????????
  • Selenium Core
  • ??Selenium Core,?????web????,?????????,??Selenium
    Core(???DHTML/JavaScript)????????google.com???Sel
    enium Core??DHTML/JavaScript?,?????JavaScript?????
    ???JavaScript???????????????webserer, Selenium
    Core??????????????Selenium IDE??Selenium RC???

8
Selenium??
  • Selenium RC
  • ?Selenium Remote Control?Selenium
    RC??????????,?????????????,?C,Python?????????,???
    Selenium???????(?Nunit)??????? Selenium
    RC??????????
  • a. Selenium???b. Selenium Server??????c.
    Selenium???????????????Selenium???Server????????s
    elenium-server.jar??
  • Selenium Grid
  • ???????????????????????,?????Web ????????

9
Selenium-IDE(???firefox)
  • Selenium-IDE???selenium???????????,?????firefox?,
    ??firefox??????????????,?????????web????????,?????
    ?,???????,??????????
  • ??
  • ???????????????
  • ?????id,name?xpath?????????
  • ????selenium???
  • ???????????
  • ????????????????
  • ???????????????

10
Selenium-IDE??
  • ????????firefox(3.6??),??(http//seleniumhq.org/do
    wnload/)??selenium-IDE?
  • ???,?FireFox???????selenium-ide.xpi????,????FireFo
    x?,?????Tools Selenium IDE??Selenium IDE????
  • ??IDE????????????,????????????WEB???????,IDE??????
    ????,??????????????Selenium??(Command)????????????
    FireFox???????,????TestRunner????????? ?
  • ??????????????????,??options-format????????????fo
    rmat?????,???Options??,?Enable experimental
    features???

11
Selenium-IDE??
12
Selenium-Core
  • Selenium-Core???JS?DHTML???,?????????????,????????
    ???????????????????(selenium-ide???firefox?????,??
    ??)????????selenium-core???www.google.cn??????????
    ,????selenium-core??????????????
  • Selenium???????,test-runner?dirven??Selenium-core?
    ?test-runner?????
  • Selenium test runner ??,??????(test case),??
    HTML????????????????

13
Selenium-Core
14
Selenium-RC
  • Selenium-RC???????????web??????,??????????????js?
    ?????
  • Selenium-RC?????
  • Selenium Server
  • Selenium Server?????????,????,Selenium
    Server??????Launcher?Http Proxy?Selenium
    Core,??Selenium Core??Selenium Server??????,??????
    ???Selenium Core???Javascript????,?Selenium
    RC????? Selenium Server???(?????Http
    Get?Post??),Selenium Server????????Selenese
    Command,?????????JS???????????

15
Selenium-RC
  • Selenium Libraries
  • ??????????Selenium Server?,??????????,???????????
    Selenium??,Client Libraries????????????Selenium
    RC ?????????????Selenium?????????????????,????????
    ????????Selenium Command,????????????Selenium
    Command?????????????????Selenium
    Command?Selenium Server??,????????????????????????
    ?Selenium Command???????,???????????????????????
    ???Selenium IDE??Selenium-RC???

16
Selenium-RC
17
Selenium-RC?????
18
Selenium-RC?????
  • 1. Testcase??client lib?server??http??,???selenium
    server?????
  • 2. Selenium server??Laucher?????,?selenium
    core??????,????????????selenium server?http
    proxy?
  • 3. Testcase??client lib?server??http??,server?????
    ??,????http proxy??js????selenium core????????
  • 4. Selenium core???????????
  • 5. ????????????????http?????web??
  • 6. Selenium server???????http???????http??,?????we
    b???
  • 7. Selenium server?http proxy?web?????????

19
Selenium-RC ????????
  • ????????????
  • ?????Netscape??????js??????web?????,js?????

20
Selenium-RC ????????
21
Selenium-RC ????????
22
Selenium API-Commands (??)
  • Element Locators (?????)
  • String Matching Patterns (???????)
  • Select Option Specifiers (Select ?????)
  • Actions ????????????
  • Action ????? action ?actionAndWait, action
    ?????,?actionAndWait ??????????????action???,?????
    ,open ????????????
  • Assertions ???????????
  • ???? Assert ?Verify, ?Assert ??,??????Verify
    ??,????????
  • Parameters and Variables
  • ?????????????????JavaScript??????

23
WebDriver
  • selenium2.0 selenium1.x webdriver
  • Selenium2.0 WebDriver????
    http//my.oschina.net/willSoft/blog/28119
  • ??
  • ??????
  • ???Server
  • ???,??????,???,???? ?
  • ???? ?
  • ?? ?
  • ??Ajax?UI?? ?
  • ??
  • ???Selenium-Grid

24
WebDriver API ? SeleniumRC API
  • WebDriver API??Login??
  • public void login()
  • driver.switchTo().defaultContent()
  • driver.switchTo().frame("mainFrame")
  • WebElement eUsername waitFindElement(By.i
    d("username"))
  • eUsername.sendKeys(manager_at_ericsson.com)
  • WebElement ePassword waitFindElement(By.i
    d("password"))
  • ePassword.sendKeys(manager)
  • WebElement eLoginButton
    waitFindElement(By.id("loginButton"))
  • eLoginButton.click()

25
WebDriver API ? SeleniumRC API
  • SeleniumRC API??Login??
  • public void login()
  • selenium.selectFrame("relativetop")
  • selenium.selectFrame("mainFrame")
  • selenium.type("username","manager_at_ericsson
    .com")
  • selenium.type("password","manager")
  • selenium.click("loginButton")

26
??-Selenium IDE???
  • ??Selenium IDE,??????
  • ??????http//www.baidu.com/
  • ???????,??????hyddd?
  • ???????
  • ?????????,?????????(?hyddd - ???),????????,??Ver
    ify TestPersent
  • hyddd - ????
  • ???????(???hyddd - ???)
  • Firefox ?????Tab ??,?????????
  • ?????

27
??-Selenium IDE???
28
??-Selenium IDE???
29
??-Selenium IDE???
30
??- Selenium RC ????
???Selenium IDE ??????????????,?C?????????????NU
nit ?????
31
??- Selenium RC ????
  • 1. ?????? SeleniumTest
  • 2. ??DLL ??
  • nunit.framework
  • ThoughtWorks.Selenium.Core.dll

32
??- Selenium RC ????
  • 3. ??????????????

33
??- Selenium RC ????
  • 4. ??Selenium ?????
  • ??cmd ??selenium-server-1.0-beta-2??,??java
    jar selenium-server.jar(?????JRE),??Selenium
  • ??????

34
??- Selenium RC ????
  • 5. ??????

35
Its Over,Yeah Thank You Bye Bye
Write a Comment
User Comments (0)
About PowerShow.com