python selenium ddt 数据驱动测试(五)

3、数据文件

14633667-e007273babf95073.png

项目中配置文件的路径

gateway.conf

[gateway]
# 测试链接
login = http://192.168.xx.xx:xxxx/Test/

[domain]
# 测试支付域名
put_pay = /web/test1
put_standard = /web/test2
put_ncgame = /web/test3
put_safe = /web/test4
put_inst = /web/test5
put_multiple = /web/test6
put_quick = /web/test7
put_ever = /web/test8
put_secure = /web/test9
put_web = /web/test10
put_virtual = /web/test11
put_webbr = /web/test12
put_starcor = /web/test13

[xml]
# 页面元素文件路径
home = /data/locator/home/Gateway.xml
pay = /data//locator/gateway/PayPage.xml
result = /data//locator/gateway/ResultPage.xml
threepay = /data/locator/gateway/ThreePay.xml
threequick = /data/locator/gateway/ThreeQuick.xml
halfpay = /data/locator/gateway/TwoHalfPay.xml
halfquick = /data/locator/gateway/TwoHalfQuick.xml
twopay = /data/locator/gateway/TwoPay.xml
twoquick = /data/locator/gateway/TwoQuick.xml
check = /data/locator/gateway/Check.xml

[xlsx]
# 测试数据文件路径
threepay = /data/testdata/gateway/ThreePay.xlsx
threequick = /data/testdata/gateway/ThreeQuick.xlsx
halfpay = /data/testdata/gateway/TwoHalfPay.xlsx
halfquick = /data/testdata/gateway/TwoHalfQuick.xlsx
twopay = /data/testdata/gateway/TwoPay.xlsx
twoquick = /data/testdata/gateway/TwoQuick.xlsx
check = /data/testdata/gateway/Check.xlsx

[addr]
thr = /PaymentGateway/test
thrcre = /PaymentGateway/test/create
thrpay = /PaymentGateway/test/directtest/quick
two = /PaymentGateway
twocre = /PaymentGateway/test/directtest/create
twopay = /PaymentGateway/test/directtest/quick
twh = /PaymentGateway/test/indirecttest
twhcre = /PaymentGateway/test/directtest/create
twhpay = /PaymentGateway/test/directtest/quick
check = /test/check/
track = /test/uploadTrackingNo
apply_ref = /test/applyRefund
query_ref = /test/queryRefund

日志配置

logging.conf

[loggers]
keys=root,AutoTest

[handlers]
keys=fileHandler

[formatters]
keys=form

[logger_root]
level=INFO
handlers=fileHandler

[logger_AutoTest]
level=INFO
handlers=fileHandler
qualname=AutoTest
propagate=0

[handler_fileHandler]
class=handlers.TimedRotatingFileHandler
args=("logs/catalina.log", 'd', 1, 0, 'utf-8')
level=INFO
formatter=form

[formatter_form]
format=%(asctime)s - %(name)s - %(levelname)s - %(message)s
datefmt= '%Y-%m-%d %I:%M:%S %p'

元素定位

ThreePay.xml

<?xml version="1.0" encoding="UTF-8"?>

<map>
    <!-- 测试页面 -->
    <page pageName="paythree">
        <!--Locator lists -->
        <locator type="id" timeOut="5" value="suburl">ComboboxAddr</locator>
        <locator type="id" timeOut="5" value="account">AccountId</locator>
        <locator type="id" timeOut="5" value="terminal">TerminalId</locator>
        <locator type="id" timeOut="5" value="order_amount">OrderAmount</locator>
        <locator type="id" timeOut="5" value="btnAdd">MakePayment</locator>
    </page>
</map>

测试数据

14633667-b9da528aecafb433.png

转载于:https://www.jianshu.com/p/f47065c04fe5

猜你喜欢

转载自blog.csdn.net/weixin_33739627/article/details/91057438