Skip to content
/ 12306 Public

12306 抢票程序。本项目可以作为企业/团队内 UI 自动化项目来使用。

License

Notifications You must be signed in to change notification settings

izachwei/12306

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ,谢谢。

About

12306 抢票程序。本项目可以作为企业/团队内 UI 自动化项目来使用。

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages