Skip to main content

Chinese To Python Code

Project description

ctpc

介绍

致力于将汉语关键词转变成Python代码 基于中文的业务驱动的进行测试

软件架构

基于Selenium库进行二次开发便以编写业务驱动

安装教程

pip install ctpc

使用代码之前请确保您的电脑中已经安装好浏览器及对应的驱动内容
chrome chromedriver
ie iedriverserver ×
firefox geckodriver ×

chrome与chromdriver驱动之间存在不兼容问题,所以最好都下载最新版本为最佳效果

使用说明

实例:

from ctpc import run

"""
    run的参数注解
        case    :用例文件的内容[支持:txt/csv,json]
        limiter :用户文件数据的分隔符[支持:',', '\t']
"""

# 如果您的脚本写在了TEXT文本中可以使用如下脚本
with open('xiaobai.txt', 'r') as f:
    run(case=f.read(), limiter=',')

# 如果您的脚本写在了CSV文本中可以使用如下脚本
with open('xiaobai.txt', 'r') as f:
    run(case=f.read(), limiter=',')

Case文件实例

打开,,https://www.baidu.com,
输入,//*[@id="kw"],小白科技,
点击,//*[@id="su"],,
等待,,5,

打开,,https://www.baidu.com,
输入,//*[@id="kw"],小白科技,
点击,//*[@id="su"],,
等待,,5,

备注:
空白行为区别不同Case的作用(同上实例为两条Case

参与贡献

了解项目源码

作者: @Tser
©小白科技

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for CTPC, version 0.0.1
Filename, size File type Python version Upload date Hashes
Filename, size CTPC-0.0.1-py3-none-any.whl (4.5 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size CTPC-0.0.1.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page