游戏测试 【自动化测试】网易 AirTest 和腾讯 GAutomator 的对比(二)

特尔斯特 · March 15, 2021 · Last by 特尔斯特 replied at March 16, 2021 · 3418 hits

基于上次的测试对比并不能得到这两个工具的优劣,所以今天又进行了一些测试。
我只是写了一个简单的脚本目的是实现 “把卡拖到战场中某个己方目标的身上”,结果在运行 Airtest 的时候感到了明显的卡顿。

测试环境:雷电模拟器
测试工具: Airtest GAutomator
测试脚本:
airtest:

# -*- encoding=utf8 -*-
from airtest.core.api import *
from airtest.cli.parser import cli_setup
from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()

# script content
print("start...")

poco("Card_0").click() #点第一张卡
poco("m_head").child("****").click()#再点击到目标位置(就是这一步明显的模拟器卡了一下)

GAutomator 脚本:

import wpyscripts.manager as manager
from   wpyscripts.tools.basic_operator import find_element_wait
import time

class Battle:

    def __init__(self):
        self.engine = manager.get_engine()
        self.logger=manager.get_logger()

    def button_click(self,button_name):
        button_battle = find_element_wait(button_name)  # 等待按钮的出现再点击按钮
        self.engine.click(button_battle)

    #放卡牌
    def  release_card(self,card_name):
        self.button_click(card_name)  #点第一张卡
        head  = self.engine.find_element("m_head/********")#再点击到目标位置(和airtest不同,这里没有感受到任何的卡顿)
        bound = self.engine.get_element_bound(head)
        print("把卡放在",bound.x,bound.y)
        self.engine.click_position(bound.x,bound.y)

if __name__=='__main__':
         battle = Battle()
         battle.release_card("Card_0")

结论:如果仅仅是这么简单的 “把卡拖到战场中某个己方目标的身上” 就能导致卡顿,那根本就不适用于性能测试以及其他自动化测试。
所以经过这两次的对比,我选择 GAutomator 作为后续开展游戏自动化的核心工具。

共收到 2 条回复 时间 点赞

有点文不对题,如果真想对比两款工具,做这些还不够,结论也不该是非好即坏的表述方式。
参考下虫师的,https://www.cnblogs.com/fnng/p/14230840.html

MarvinWu 回复

只关注核心的东西,太多的懒得写

特尔斯特 关闭了讨论 25 Mar 15:23
特尔斯特 重新开启了讨论 25 Mar 15:58
需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up