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

     

     

     

  • 相关阅读:
    c# 子窗体打开或者切换就最大化
    TreeView失去焦点时亮显选中状态
    解决 RecursionError: maximum recursion depth exceeded
    CentOS7安装jdk1.8
    CentOS7安装mysql5.7
    CentOS7安装redis3.2.3
    CentOS7安装nginx1.8
    centos7设置redis开机自启动
    Linux下执行sh脚本报错:$' ': command not found
    Linux下使用unhide查看隐藏文件
  • 原文地址:https://www.cnblogs.com/lyli/p/5395835.html
Copyright © 2011-2022 走看看