RajeshK Posted July 31, 2018 Share Posted July 31, 2018 Hi there, I am new to AutoIT and need to implement AutoIT script for SunAwtFrame which has Help menu in the toolbar, problem is that with WinMenuSelectItem, unable to select Help menu in toolbar. I have gone through some of the answers and came across SimpleSpy.au3 and when launched SimpleSpy.au3 it displayed as below and have no idea about how to look for the elements I have wrote the below script Run("C:\Program Files\Sweet Home 3D\SweetHome3D.exe") WinActivate("[CLASS:SunAwtFrame]") WinWaitActive("[CLASS:SunAwtFrame]") $hWnd = WinGetHandle("[CLASS:SunAwtFrame]") $hMain = _GUICtrlMenu_GetMenu($hWnd) $t1 = _GUICtrlMenu_GetItemText($hMain, 0) $hFile = _GUICtrlMenu_GetItemSubMenu($hMain, 0) $t2 = _GUICtrlMenu_GetItemText($hFile, 1) WinMenuSelectItem($hWnd, "", $t1, $t2) Immediate help is highly appreciated. Thanks Link to comment Share on other sites More sharing options...
Earthshine Posted July 31, 2018 Share Posted July 31, 2018 use the code from simplespy and see if it highlights and can click on stuff at least. start from there. My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
RajeshK Posted July 31, 2018 Author Share Posted July 31, 2018 If you can see the screenshot I attached for simplespy, as I did not see a way to spy for the elements that I am looking for Link to comment Share on other sites More sharing options...
Earthshine Posted July 31, 2018 Share Posted July 31, 2018 (edited) post the code generated using the code tags <> don't post images of code. that is useless. point your mouse over the elements you want, and Ctrl-W to get the code. Edited July 31, 2018 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
RajeshK Posted July 31, 2018 Author Share Posted July 31, 2018 I dint get that, as said I am new, can you let me know the steps to do what you just said Link to comment Share on other sites More sharing options...
Earthshine Posted July 31, 2018 Share Posted July 31, 2018 (edited) when you reply to a post, there is a bar with a bunch of stuff on it and one of those things is the code tags, they look like this <>, you click on that and post your code into that and insert it into your posts here, then we can easily see it, copy it and test it if possible. when you run simplespy, put the mouse over the application you want to interact with and press Ctrl-W like it says and it will put code in there you can copy and test with and develop with. Edited July 31, 2018 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Earthshine Posted July 31, 2018 Share Posted July 31, 2018 also, being new and using IUIAutomation isn't a really good combination. You will need to learn much and be patient. Mostly you need to learn. My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
RajeshK Posted July 31, 2018 Author Share Posted July 31, 2018 20 minutes ago, Earthshine said: point your mouse over the elements you want, and Ctrl-W to get the code. Sure, will learn, thanks, but currently I am working on some POC and have to submit it, so need solution for that, the above lines you said, is that referring to Simplespy ? If that is the case, I dont see a way for spying the elements Link to comment Share on other sites More sharing options...
Earthshine Posted July 31, 2018 Share Posted July 31, 2018 (edited) just point mouse over your application that you wish to automate and click into something you care about, then try Ctrl-W like I said, you being a beginner, this isn't going to work for you probably. You have far too much to learn. You might be better with a commercial product that can handle Java like TestComplete if you can't do that, start with the examples and get them all to run in the IUIAutomation and the UIA Examples zip. you can learn a lot from those. Edited July 31, 2018 by Earthshine My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
RajeshK Posted August 1, 2018 Author Share Posted August 1, 2018 Thanks for your inputs, but as part of my POC, I need to come up with open source tools for windows apps automation. Kindly let me know if there is any easy solution or alternative for my scenario listed in my 1st post as I dont have much time to spend on this but on learning side definitely I will try all those examples Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now