Learn Airtest stepped pit

When run py script error:

 

There may be two reasons:
1, run only the selected codes

 

Poco not using this operation, this operation is equivalent to no insertion poco associated libraries, so naturally can not be identified poco;

2, at the beginning is not inserted poco library
plus:
from poco.drivers.android.uiautomation Import AndroidUiautomationPoco
poco = AndroidUiautomationPoco (use_airtest_input = True, screenshot_each_action = False)
ok.

When I do this:

 

It is given! ! Tip: unindent does not match any outer indentation level

This situation is not aligned will appear. So I went back to play it again, make sure that has been aligned. But still error.
Then I tried to run globally, was able to run properly!
Then I wrote the if-else outside the method:

 

Select the code runs successfully.
It concluded:
In a function, select the if-else (and possibly others), it is not recognized by the system used in the function, so the default judgment, or if you have a lot of space in front else, it will complain!

Guess you like

Origin www.cnblogs.com/dreamhighqiu/p/10989914.html