-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running on older Windows versions (7, 8 & 8.1) (was: how to run this in win64) #52
Comments
Hi, Do you mean with 64-bit WIndows, or 64-bit Java? |
I try to run it with the follow code
But when I run this it gives a Exception
win8 64bit and jdk1.8 64bit |
Do you see Notepad start? |
I saw the Notepad window |
WinNT.HRESULT result0 = uRoot.QueryInterface(new Guid.REFIID(IUIAutomationElement3.IID), pRoot); |
Hi, thanks. This looks like it a Windows 8 issue - The IUIAutomationElement3 interface is only available in Windows 8.1 and above. I don't have access to a Windows 8 machine on which to test this. I will think about what needs to be done over this weekend, unless you feel like having a go at trying to fix it? |
These are the minimums for the parts that we are using internally,
|
Update: I have created a branch called "windows8-legacy-support", which has an example implementation for a possible version that supports Windows 8, using the IUIAutomation2 and IUIAutomationElement2. If you run the MainLegacy demo, and let me know whether it works (I don't have machine on which to test it). If it is OK, I have some refactoring to do on it, as it has lots of copied code in, but it SHOULD work. |
it return "Not found, retrying" |
Well, it's a start. It is now loading the controls properly, and looking for the notepad application. Is you Windows installation non-English? It might not be able to find the name of the window if it is not 'Notepad'. It would be possible to add support for other languages here, but if the window title is non-English, then change the demo to try and find the window. Meanwhile I will see if the Notepad example works with the Legacy version. |
I have very same issue. My environment is Windows 7 64bit - English version. Java jdk1.8.0_05. Code:
Exception in thread "main"
I do not have any Visual Studio installed (I try to take the biggest possible JNA advantage on clean windows + Java). |
Hi, I think this is the same thing, but for Windows 7, it uses the even earlier version of the COM library. I will make the legacy version use the oldest available library and make sure it still works - it will go into the windows8-legacy-support branch if you can get the code out and build it yourself. |
OK, I have merged all the elements to use the lowest version of the code by default, which as broken one thing, but that is only used in my demos, and I can probably work around it sooner or later. |
I have downloaded both your newest version and this: |
Are you using Wndows 7 as above? |
Yes, I am. It's installed as guest OS in VirtualBox. |
Hmm. That should work, I will try on a Windows 7 machine tomorrow. |
hi, |
IUIAutomation is still supported on all platforms. There is one call to IUIAutomationElement3 - to show a popup men, but that should fail gracefully if called from Window 7 or 8 |
i know IUIAutomation is supported on all platforms but when trying to open Calculator or get any element it fails on Windows 7 64 that support only IUIAutomation. |
Are you looking at the https://github.com/mmarquee/ui-automation/tree/windows8-legacy-support branch, as that is where the changes are? Like you said this has involved replacing all the IUIAutomationElement3 and IUIAutomation3 with their previous versions. |
i have tried the legacy branch but it still has issues and not working good with windows7 64. public IUIAutomationElement getAutomationElementFromReference(final PointerByReference pbr)
|
Thanks, - OK, I've fixed that and committed again, so can you test again. |
I just checked - still getting exactly the same NullPointerException (I took latest 'windows8-legacy-support' version). Any Idea what I could have done wrong? Is there anything I could check for you? |
@parvuselephantus Is it the same stack trace as before? Code you send me the code that makes it happen? That way I can see whether there is anything obvious about that would make it not work, and it myself and debug it. |
(also see update above) |
Hi @mmarquee. Sorry for that, but I confirm it's all exactly same: same code, same win7 64bit, same stacktrace (even numbers of lines are same). I have just downloaded the newest version of ui-automation-windows8-legacy-support branch. |
@parvuselephantus Oh no. I am not going to be near a Window 7 PC until tuesday (and even then might not be able to get to use it). I'll try and get access to it and see what happens. |
@parvuselephantus I have just run this on a Windows 7 machine, and it fails (even when run from the legacy branch), so I have something to work through now. It should work, as the interface is implemented in Windows 7. |
The issue is in Not sure why that would fail on Windows 7. |
I have merged the changes in the legacy branch(well applied the necessary changes). It has been published as a snapshot (0.5.0-SNAPSHOT), which has a lot of other changes as well. I don't have access to a Windows 7, or 8/8.1 PC, so it would be great if someone could test this on one of those and feedback to me here. |
I have it running successfully on Windows 8.1, but it fails to run on Windows 7 saying:
|
Hmm. That was what I was seeing on my old WIndows 7 laptop (which is at work). I am really not sure that Windows 7 actually supports this library. |
Hey, |
It is still an ongoing issue I am afraid. The Microsoft documentation implies that it should work (at least in it's most basic implementation) on Windows 7 (and in Vista), however from investigating on several Windows 7 machines, this doesn't seem to be true. (see comment above). So at the moment the library does not support Windows 7. It should be possible of do much the same automation using the older (but still supported MSAA - |
See this document for details https://github.com/mmarquee/ui-automation/blob/master/docs/windows-support.md |
Okay thanks, this is good to know. |
I was hoping to ignore this, but it is the single most active issue I've got, so once I have tidied the code up a bit - I have some additional code to merge in, then I might return to it - I have some MSAA support already, but that might require the UIAutomationCore library and so we would be stuck again. Keeping it seamless would be the key, and the library would have to degrade nicely back to MSAA if nothing else is available. something I would have to simulate in Windows 10. I will have play with this over the weekend and see whether I can work out how to make a start. |
Ok, I've checked MSAA and I don't think it's that what im looking for, because there are too many improvements on the UI Automation side. |
I have bought a Windows 7 machine to look at this issue. I'll start to look at this asap. |
@mmarquee Wow! You bought a Windows 7 machine especially for it, can we help you? Like donations or something? |
It was the cheapest laptop I could find, so very cheap. Also very slow! I've managed to get the code on there and running. 'Good news' is that most of the tests fail - so it's something to work on, as I am getting the same behaviour as everyone else. |
@mmarquee Is there a possibility to contact you by email. We have professional interest and might need some help in the world of Java + UI Automation. |
I've added a contact email to my profile - it is just for github traffic, so I don't check it every day |
I have the same issue when I use I got exception: I use your 0.4.3 version Win 7 64-bit |
Not sure about the above error, it looks different from the original issue - it might be a Java 9 issue. |
I have tried the library on Windows 7 and it doesn't work. However the uispy application does work, so I'm confused. |
I have a Windows 7 laptop and Eclipse.
|
@violinner That's great news for testing native windows applications on Windows 7. We can build upon that information to improve the ui-automation lib. As you also recognized, Java Swing applications are not mapped to the UI-Automation framework by Java, so you need test-software which especially integrates with Java UIs, as for example QF-Test (https://www.qfs.de/en.html) or others. (Disclaimer: I'm an active contributor of the ui-automation-library as well as a developer of QF-Test) |
@violinner Thanks. As @pbi-qfs noted the Swing controls are opaque to IUIAutomation, all it sees is the overall window. |
@mmarquee also: Does this help? |
@violinner Thanks - that is what I see on my Windows 7 machine, which doesn't work. I will have a look when I get back tonight. |
Looking at the code I have in the current branch, it doesn't mention |
Hi @mmarquee |
On Windows 10 is working fine, but on Windows 7 64 bit i just tried and it is not working. JAR ver: ui-automation-0.4.3.jar It is failing when trying to get the Form, e.g.:
java.lang.NullPointerException |
OK, this is the same issues as everyone has. I don't think it is going to be possible to make this library work on Windows 7. I have a Windows 7 PC to experiment with, but I cannot get this libraries to load properly. |
CANALIZED_OLE32_INSTANCE = Canalizer.canalize(com.sun.jna.platform.win32.Ole32.INSTANCE); |
No description provided.
The text was updated successfully, but these errors were encountered: