Airtest the game automation (5 minutes to teach you the King of pesticides brush gold) AirtestIDE Comments (cross-platform UI Automation editor)

 

First, the preparatory work:

  1) installation of Tencent hand travel assistant, download the king of glory, start the installation (  you can also connect the phone directly to start the game, or use other simulators   )

  2) Installation AirtestIDE, connected gaming device in Windows window (for details refer to the author another blog post:  AirtestIDE Comments (cross-platform UI Automation editor) )

  

   3) switch to the adventure game mode, select any level.

  

 

Second, write a script:

  1) Click on touch controls and the interception of "checkpoints" picture:

  

 

  2) Ibid, interception "Skip", "automatic", "click on the screen to continue", "re-challenge" picture is as follows:

    

 

  3) Because there are from time to time during the game "pick-off" prompt, so we need to add point exists () judgment and while loops.

    Namely: the screen in the game before the end, every second retrieves whether there is "Skip" pop, if you click "Skip."

    

  

  4) Because different device performance, resulting in fast or slow screen switching, so we add the wait point wait method (), the default timeout = 20s.

    

 

  5) Finally, we want the whole process is repeated to perform, so we also need to add the outermost layer while () loop, determining conditions is the beginning "checkpoints" appears.

    Here we touch after "checkpoints", he added sleep (10), because it takes time to load into the game, but also longer.

    

 

Third, the formal operation

  1) you're done, run them, brush brush! ! !

  

  

  2) Is not it simple? If you do not want to cut diagram, you can also click the Record button Airtest auxiliary window,

  

  But still finished recording the script still needs some adjustments manually, of course, this only applies Airtest image recognition, if required complex operations, it is recommended in combination with other modules.

   

 

Guess you like

Origin www.cnblogs.com/leozhanggg/p/10976833.html