Code Monkey home page Code Monkey logo

12306's Introduction

12306

12306 抢票程序

10.1 国庆放假没抢到票,写了一个抢票脚本,人肉去抢实在抢不过啊。。。

快速开始

环境准备

  • JDK 17
  • Maven

项目自身引用 WebDriverManager 自动下载管理 WebDriver,无需本地维护。

命令行执行

  1. 拉取代码
  2. 修改配置文件中对应的参数: startup.properties img.png
  3. 执行命令 mvn test -Pweb-execution -Dsuite=local -Dtestng.dtd.http=true

代码执行

  1. 拉取代码
  2. 修改配置文件中对应的参数: startup.properties img.png
  3. 执行测试用例 Ticket12306Test.java

注意

执行过程,需要在手机端打开 12306 软件进行扫码登录

文件说明

  1. startup.properties 用于配置购票信息 img.png
  2. general.properties 用于配置 Selenium Driver img.png
  3. 12306.properties 12306基础配置信息
  4. selenium-grid.properties 用于配置远程 Selenium-grid
  5. suites 用于工程化自动化测试

最后

本项目只实现了一个简单的 12306 抢票,你也可以基于本项目完成更多自动化流程,例如:大麦网购票。
该项目可以作为您的初始测试架构,以加快搭建自动化项目进度,完全可以作为企业/团队内 UI 自动化项目来使用,可扩展性(local, selenium-grid or testcontainers)、可维护性(内部包结构、模块、实体类定义)。
最后,如果该项目帮你买到了车票,给你带来了帮助,或者让你熟悉了 Selenium 的常见用法,请给个 Star ,谢谢。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.