Jump to content

Working with SunAwtFrame


 Share

Recommended Posts

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

image.thumb.png.78ce8ea3baeef729ba74115983c2f37c.png

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

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 by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

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 by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

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

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 by Earthshine

My resources are limited. You must ask the right questions

 

Link to comment
Share on other sites

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...