zoukankan      html  css  js  c++  java
  • Software Testing 2nd Lab --- Selenium

    < Selenium IDE >

    1.Install 

    Download SeleniumIDE at http://www.seleniumhq.org/download/ . Note that SeleniumIDE can only work with Firefox, so you'd better have Firefox installed before installing SeleniumIDE.

    Figure 1

    Figure 2

    2. Record Test Case

    • Click the icon of SeleniumIDE in the upper right of Firefox

    Figure 3

    • Click the red dot in the upper right of the pop-up window to begin to record

    Figure 4

    • While recording, we can visit any webpage, input keywords in the textbox, click the link url, and etc. Then click the red dot again to stop recording. All of the operations will be listed in the middle pane.

    Figure 5

    • Drag the slide bar in the upper left to Slow, or else it'll report failures when we are to click a new link in the webpage somehow. Then click the green triangle right next to the slide bar to play entire test suite. It will then go through operations as we did before. And if there is  nothing going wrong, we will have it like following.

    Figure 6

    3. Export Test Case

      File -> Export Test Case As... -> Java/JUnit4/WebDriver

      Here is the overview of the exported file(testcase.java)

    Figure 7

    < Selenium WebDriver >

    1. Install

    • Download Selenium WebDriver at http://www.seleniumhq.org/download/

    Figure 8

    • Add jars in libs folder and extra selenium-java-2.53.0.jar and selenium-java-2.53.0-srcs.jar to the Build Path of the project

    Figure 9

    Figure 10

    2. Code to test if the studentIDs and emails in info.csv macth in pairs

    • Following figure is just the overview of the code, plz check the complete version of the project at https://github.com/liyinglan/Lab2_Selenium_new

    Figure 11

     

    ---------------------------END--------------------------

     

     

     

  • 相关阅读:
    JQuery Ajax 在asp.net中使用小结
    加班对你的提升有多大?
    .net学习笔记---HttpResponse类
    .net学习笔记----HttpRequest类
    MVC学习笔记---MVC生命周期
    MVC学习笔记---MVC生命周期及管道
    .net学习笔记---HttpHandle与HttpModule
    C#学习笔记---修饰符,this关键字和static关键字
    C#学习笔记---如何提高代码逼格
    Linq学习笔记---Linq to Sql之where
  • 原文地址:https://www.cnblogs.com/lyli/p/5395835.html
Copyright © 2011-2022 走看看