3

enter image description here Hi,everyone Nowadays I have been working on automating the Flygram app using python package such as pywinauto, pyautogui, however, I got stuck in the problem. When the script runs and finds the Flygram app, there are two instances of Flygram. The worse thing is that there are no subclasses of Flygram. Even I used pyinspect, it didn't find the subclasses. Please help me someone who knows how to handle this kind of problem. Thanks.

from pywinauto.application import Application
import pywinauto.mouse as mouse
import pywinauto.keyboard as keyboard
import time

app = Application(backend='uia').start(r"C:\Flygram_PC\Flygram.exe", timeout=10)
time.sleep(3)
app = Application(backend='uia').connect(path=r"C:\Flygram_PC\Flygram.exe")
  • What do you mean saying "subclasses"? I don't understand. On the screenshot I see SWAPY which is old and unsupported. py_inspect is newer, but Inspect.exe shows more info (it's a tool from Windows SDK). Have you read the [Getting Started Guide](https://pywinauto.readthedocs.io/en/latest/getting_started.html) first? – Vasily Ryabov Jan 16 '22 at 08:49
  • To distinguish two processes with the same executable module you can connect by title: `Application(backend='uia').connect(title="Window Title", timeout=10)` or use `Desktop(backend='uia').windows()` and get `.window_text()` for each top level window. – Vasily Ryabov Jan 16 '22 at 08:52

0 Answers0