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

     

     

     

  • 相关阅读:
    【IDEA】颜色主题 Color Theme
    【IDEA】IntelliJ IDEA 2020.1破解版
    【HTML】基础
    SQLyog
    【GitHub】本地代码上传
    【NetWork】外网和内网
    C#根据PDF模板生成内容
    layui数据表格显示与导出问题
    LayUIDataResult
    LayUIParameter
  • 原文地址:https://www.cnblogs.com/lyli/p/5395835.html
Copyright © 2011-2022 走看看