The invention relates to a method for quickly compiling a
test case on an Android platform, which comprises the following steps: S1, an android element positioning module is independent, and the positioning operation of all elements is redefined by uniformly using a
YAML language; S2, abstracting all operation behaviors of the
test case, and logically packaging the complex code into an independentoperation class, namely an Action class; S3, compiling a page file page.
Yaml to realize a Page Object mode, and completing code decoupling and
multiplexing; S4, writing a
test case file case.
yaml; S5, generating test case
executable files xxx.py from the test
case files cas.
yaml in batches through a jaja2 template language; and S6, running the
executable file xxx.py of the test case through thepytest. By adopting the method disclosed by the invention, a user only needs to write the test case by independently using a
yaml language, so that an inexperienced person can quickly write and modifythe test case. Meanwhile, the actions of element positioning and test operation are unified, redundant codes are reduced, and the code operation is more stable and efficient.