Replies: 4 comments 6 replies
-
Can anyone please help with this? Still stuck on getting this to work! |
Beta Was this translation helpful? Give feedback.
-
@vasily-v-ryabov could you please assist in any way? Thank you |
Beta Was this translation helpful? Give feedback.
-
There is possible keyword |
Beta Was this translation helpful? Give feedback.
-
Oh, great! But AFAIK
|
Beta Was this translation helpful? Give feedback.
-
@vasily-v-ryabov hoping you can help here. I originally posted to Stackoverflow but no one was able to assist successfully.
I am trying to automate the Spotify app on Windows (i.e. the Microsoft Store option). I am using UIA backend. The only problem I am having is that because pywinauto's Desktop object is looking for a specific window title, it doesn't allow me to automate as Spotify's window title can change depending on what song is being played at any given moment (and there's no word "Spotify" in the window title).
I experimented with trying to obtain the process ID, but it doesn't seem to find the exe name (Spotify.exe) or doesn't work with the Desktop object, which I need to be able to access child_window, etc. My code is below.
Can someone assist with advising how to go about making the Desktop object work when the app's window title is not constant and can't be used to identify the app, and since it's a Microsoft Store app, it spawns multiple processes so using just the Application object is not an option either.
This is my code:
I tried using what someone suggested (
dlg = app.top_window()
) along withpid = application.process_from_module(module = 'Spotify.exe') app = Application(backend='uia').connect(process = pid)
but those remedies didn't work. (Error is stillRuntimeError("No windows for that process could be found")
. Spotify's store app spawns multiple processes which probably explain the issue and with changing window titles, it seems impossible to be able to reference Spotify altogether.Beta Was this translation helpful? Give feedback.
All reactions