0

I am trying to automate Click on a button on 'Appium' software using python. I am able to open the app with the help of the below code:

from pywinauto.application import Application
app=Application().start(cmd_line=u'"C:\\Users\\...\\Appium\\Appium.exe"') #To open Appium 

Next, I have to click on the 'Start Server v1.21.0' button in the application to start the server

When I have run the following code:

app.Appium.print_control_identifiers()

I am getting an output like this:

Control Identifiers: Chrome_WidgetWin_1 - 'Appium' (L553, T140, R1366, B890) ['Appium', 'Chrome_WidgetWin_1', 'AppiumChrome_WidgetWin_1'] child_window(title="Appium", class_name="Chrome_WidgetWin_1") | | Chrome_RenderWidgetHostHWND - 'Chrome Legacy Window' (L562, T203, R1357, B882) | ['Chrome_RenderWidgetHostHWND', 'Chrome Legacy Window', 'Chrome Legacy WindowChrome_RenderWidgetHostHWND'] | child_window(title="Chrome Legacy Window", class_name="Chrome_RenderWidgetHostHWND") | | Intermediate D3D Window - '' (L562, T178, R1357, B881) | ['AppiumIntermediate D3D Window', 'Intermediate D3D Window'] | child_window(class_name="Intermediate D3D Window")

I have also gone through this link: https://www.analyticsvidhya.com/blog/2021/09/automate-windows-applications-using-python/ and from 'Inspect.exe', I have received the following info on clicking the button [Start Button info on Inspect.exe][1]

I have tried the below code and it's working but in case some other window is open in front of Appium, this process will fail.

pywinauto.mouse.click(coords = (923,667))

Is there any better method to perform the click?

Thanks in advance

kane_123
  • 1
  • 3
  • 1
    Try to activate window before mouse click. [Here](https://stackoverflow.com/questions/39794729/pywinauto-unable-to-bring-window-to-foreground) is a hint how to do that. – Hihikomori Jul 24 '22 at 18:07

0 Answers0