Testing WPF application in Jenkins

736 views
Skip to first unread message

Andrew Gray

unread,
Jun 15, 2011, 7:21:49 AM6/15/11
to jenkin...@googlegroups.com
Hi All,

I'm hoping someone out there might be able to assist with this query.  I've been trying to get this to work for 2 days to date.

Context:
Use white test framework (white.codeplex.com) or Microsoft UI Automation Framework to drive a WPF or Win32 application in Jenkins.


Scenario:
I can run the attached code (ListBoxExample WPF Application) from the command line (logged in as a user in the Adminstrators group) with the following command:

"C:\Program Files\NUnit 2.5.10\bin\net-2.0\nunit.exe" Tests.dll /xml=white-testresult.xml.

From the command line it works correctly and I see it driving the application.

When I run the same code and command (Windows batch Command) from Jenkins I get following console output:

"White.Core.UIItems.UIActionException : Couldn't find window with title Calculator in process 860, after waiting for 5000 ms"

When I restart my Jenkins service in Interactive mode it does actually launch the application, ALL attempts (so far) to get a reference to a control return null and the next Assert fails

Question:
Has anyone else experienced this and have any guidance on how to make it work?  Is it different syntax?  I have even tried the approaches recommended in Microsoft UI Automation framework examples and they also fail in Jenkins - attempts to get references to controls return null.

WishList:
A Jenkins plugin like Selenium Grid (i.e. that just work) that would drive WPF and Win32 applications using Microsoft UI Automation framework.

Thanks in advance.

Regards,

Andrew
ListBoxExample.zip

Jerome Lacoste

unread,
Jun 22, 2011, 9:42:10 AM6/22/11
to jenkin...@googlegroups.com
Have you tried this ?


If you run your Windows slave as a service, check the user that it runs under. It it is the Local Systemaccount you have to check Allow service to interact with desktop.

Andrew Gray

unread,
Jun 23, 2011, 8:52:29 PM6/23/11
to jenkin...@googlegroups.com
I got this building and executing with

Jenkins 1.415
Firefox 4.0.1
White 0.20
NUnit 2.5.10

Jenkins Service running in "Interact with Desktop" makes the difference.

That said it is looking like the vendor application (no source code access) I am testing was not developed to explicitly support the MS UI Framework.

My wishlist request still stands:
It would be great if a Jenkins plugin like Selenium Grid (i.e. that just works) that would drive WPF and Win32 applications using Microsoft UI Automation framework.

Cheers,

Andrew
Reply all
Reply to author
Forward
0 new messages