pywinauto / pywinauto

Windows GUI Automation with Python (based on text properties)
http://pywinauto.github.io/
BSD 3-Clause "New" or "Revised" License
4.69k stars 671 forks source link

PywinAuto not able to detect element on server #1308

Open Komal1988 opened 11 months ago

Komal1988 commented 11 months ago

Expected Behavior

I am trying to automate the PowerBi Desktop using PywinAuto module. It works completes fine on my local system(OS- windows10) But when i tried to do same process on my windows server(windows 10), pywinauto not able to detect any element after start the PBI desktop application.

Actual Behavior

On Server - spac.print_control_identifiers() gives below structure( log attached as server_ids.txt) server_ids.txt not showing any element.

On local machine - spac.print_control_identifiers() gives below structure (log attached as pbi_ide_local.txt)

pbi_ide_local.txt

Short Example of Code to Demonstrate the Problem

`app = Application(backend="uia").start('C:/Program Files/Microsoft Power BI Desktop/bin/PBIDesktop.exe "E:\PowerBIRestAPI\NEW_BASE\pbix_file\DNB1_DTRCA5G_DNB_Bng-Site-17032023212-1703231215.pbix"',wait_for_idle=False)

spac=app.window(title_re='.*Power BI Desktop') spac.dump_tree() spac.Home.click()#not working on server but works well on Local system `

Specifications

junkmd commented 11 months ago

I think it is quite difficult to run GUI Automation on a server, not just only pywinauto. Especially for mouse operations, we have to make sure that we do not create a situation where the mouse pointer is lost. Most of the time, you have to connect to the display and make sure that it does not sleep.

The following document summarizes the remote execution technique. https://pywinauto.readthedocs.io/en/latest/remote_execution.html

If you have a method that has worked for you, please let us know.