question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to locate opened application

See original GitHub issue

Hello, Using Robotframework+appiumLibrary and WinAppDriver, I am trying to launch a Windows Desktop app that is made using WinForms but it is consistently giving me a "Failed to locate opened application window with appId: C:/xxx/xxx/installer-win46.exe, and processId: 280. The app launches successfully and displayed on-screen but this message indicated to me that it is unable to get the sessionId and the framework is unable to interact with it. I checked the Task Manager and found the process and processId matching what WinAppDriver claimed that it cannot locate.

It will also fail at the Tear Down step, saying that “No application is open”. Why is it not detecting the app? I saw some other posting about this issue, but they have a workaround for this issue because they are using a full fledged programming language. Is there any workaround for this for Robotframework?

My Robotframework launch script looks like this:

${REMOTE_URL}     http://127.0.0.1:4723
${APP}  C:/xxx/xxx/installer-win64.exe

	Open Application  ${REMOTE_URL}  platformName=Windows  deviceName=mymachine  app=${APP}  automationName=appium

The below is the Inspect.exe output indicating that the app is a WindowsForm 10 app.

How found:	Mouse move (712,398)
	hwnd=0x00030694 ??bit class="WindowsForms10.Window.8.app.0.34f5582_r6_ad1" style=0x16C80000 ex=0x50101
ChildId:	0
Interfaces:	IEnumVARIANT IOleWindow IAccIdentity
Impl:	Local oleacc proxy
AnnotationID:	0100008094060300FEFFFFFF00000000
Name:	[null]
Value:	"Management Services"
Role:	title bar (0x1)
State:	focusable (0x100000)
Location:	{l:431, t:377, w:468, h:23}
Selection:	
Description:	"Displays the name of the window and contains controls to manipulate it"
Kbshortcut:	[null]
DefAction:	[Error: hr=0x80020003 - Member not found.]
Help:	[null]
HelpTopic:	""
ChildCount:	5
Window:	0x30694
FirstChild:	"Close" : push button : normal
LastChild:	"Close" : push button : normal
Next:	"Management Services" : client : focusable
Previous:	[Error: hr=0x80004005 - Unspecified error]
Left:	[Error: hr=0x80004005 - Unspecified error]
Up:	[null]
Right:	[null]
Down:	"Management Services" : client : focusable
IsContentElement:	false
Other Props:	Object has no additional properties
Children:	"IME" : push button : invisible
	"Minimize" : push button : invisible
	"Maximize" : push button : invisible
	"Context help" : push button : invisible
	"Close" : push button : normal
Ancestors:	"Management Services" : window : moveable,focusable
	"Desktop" : client : focusable
	"Desktop" : window : focusable
	[ No Parent ]

Screenshot: image

My environment: Windows 10 x64 Python 2.7.13 WinAppDriver running on Administrator console Robot Framework 3.0.2 AppiumLibrary 1.4.5.4

Thanks for any help/info given.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:24 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
auyongcommented, Oct 18, 2017

Latest Update: I am finally able to identify the app using the “Attaching to this application window” technique, in Robotframework.

Here’s the code snippet that worked for me:

#Open the application - the app will open but WinAppDriver/Appium will say it failed.
Run Keyword and Continue on Failure  Open Application  ${REMOTE_URL}  platformName=Windows deviceName=mymachine  app=${APP}  
#The workaround is to go back to Root (Desktop)
Open Application  ${REMOTE_URL}  platformName=Windows  deviceName=mymachine app=Root  automationName=appium
#Put the App's Name into a variable
${element}  Get Webelement  name="<the Name parameter of your app in Inspect>"
#Open the app using the variable 
Open Application  ${REMOTE_URL}  platformName=Windows  deviceName=mymachine  appTopLevelWindow=${element}	 automationName=appium

Thanks for the info and help!

1reaction
madhavankumarcommented, May 2, 2018

When I ran the test in debug mode, the desktopSession had the following exceptions :

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to locate opened application window with appId"xxx" ...
I am a bit confused because I can see that the filepath of the application can be used to launch the app but...
Read more >
Code is not able to locate my application - Support
I am trying to open calculator by passing location to desirable capabilities. ... Failed to locate opened application window with appId: ...
Read more >
Failed to locate opened application window with appId - ...
I'm trying to start the system/window32 application like “calculator and notepad” (.exe) its working fine but I have tried to start my own...
Read more >
OpenQA.Selenium.WebDriverException : Failed to locate ...
WebDriverException : Failed to locate opened application window with appId: C:\\WINDOWS\\System32\\taskschd.msc.
Read more >
Appium: failed to locate open application error
I am using C#, Appium, and WinAppDriver to automate UI tests on a desktop application, however, I continue to have an intermittent issue ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found