1

MSDN page Supported Configurations and Platforms for Coded UI Tests and Action Recordings tells that Java platform is not supported. But now Java development is possible with Visual Studio Team Services (VSTS) and Team Foundation Server (TFS) (https://java.visualstudio.com/) so it is strange for me that in Coded UI Test there is no Java GUI testing support.

I tried to record actions for Java GUI in Microsoft Test Manager and it handles the task quite well (but this tool is primarily for manual testing and recording is just to help handle manual test steps). Still there is a possibility to export MTM tests to CodedUI tests in C# so may be there is something wrong in Coded UI Test support matrix? And it is possible to use MS Coded UI Test framework to test Java GUI application.

P.S.: I do not have VS Ultimate or Premium to check this feature (Coded UI Tests is only available in them)

1

You can download a 90-day trail of Visual Studio 2015 enterprise to test it out.

The Coded UI testing framework relies on the Microsoft UI Automation framework. Any GUI tool that does not implement MS UI Automation hooks cannot be automated with Coded UI. It seems the Java SWT uses native windows controls and this should be automatable with Coded UI according to this answer.

So if the Java GUI uses native elements it could work, other-wise not. Guess this is way its not in the matrix.

I have worked with libraries that didn't implement this and I could not automate them. I wrote a very simple Image-based testing class for Coded UI that could help working with this.

1

The support matrix is right: Java GUI testing is not supported by Coded UI Test.

Generated code from recoded MTM test-case uses native Windows OS elements to work with and all actions (mouse clicks & key typing) are linked to them, e.g.:

...
Mouse.Click(someClient, new Point(239, 90));
Mouse.Click(someClient, new Point(139, 193));
Mouse.Click(someTitleBar, MouseButtons.Right, ModifierKeys.None, new Point(233, 9));
...

MTM can record actions on Java GUI just because it uses Mouse.Click(obj, point) and key typing events, the first one uses coordinates from GUI elements that treated like Windows native (window & it's titlebar)

  • Coded UI always adds a Point, it always click relative to the clicked object. If you have a button and click in the center it will add a X/Y offset to match where you clicked on the button. If you didnt click the titleBar then it maybe combines objects into a larger container and you do not reach the elements them selves. Using the test builder you can hover elements and it draws a border around them. This way you can verify if individual items are reachable:msdn.microsoft.com/en-us/library/… – Niels van Reijmersdal Jun 29 '16 at 12:27
  • @NielsvanReijmersdal, still the same result - builder can see only top most container (window frame) – Ivan Gerasimenko Jun 29 '16 at 13:10
0

Just download UI spy tools from:https://github.com/blackrosezy/gui-inspect-tool and see it can fetch UI information from your GUI.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.