Firewall
Firewall popup box sometimes prevents auto test running. I suggest to close it by command but not UI operation for a stable effect.
// close firewall
netsh advfirewall set allprofiles state off
// open firewall
netsh advfirewall set allprofiles state on
Activate software
One side effect of running command is the code can't detect the tested software, which will report pywinauto.findwindows.ElementNotFoundError
.(Perhaps unfocused issue??)
After I tried several times, if I click anywhere, connect_device()
will work again. And before connect_device()
, poco().click()
can't be used. Now, we need to call pywinauto
directly(which is also the basic module of airtest, no need installing).
from pywinauto import mouse
mouse.click(coords=(0, 0)) # click upper left corner
connect_device("...")
网友评论