Flashfires Posted February 10, 2017 Share Posted February 10, 2017 Hello Folks, I'm new to AutoIT and hoping you can help me out. I'm interacting with a java application and don't have access to any of the controls. But I need to select certain values within a dropdown list. This has proven difficult. To accomplish this, I've taken screenshots of the values I need to select in the dropdown. I can open the dropdown list via clicking on screen coordinates. What I need AutoIT to do, is give me the "x, y" coordinates of the item by looking at the screenshot so I can click it. I hope that makes sense, let me know if you need more details. Thanks! Moe Link to comment Share on other sites More sharing options...
water Posted February 10, 2017 Share Posted February 10, 2017 Welcome to AutoIt and the forum! Did you have a look at this UDF (library of User Defined Functions) which lets you automate Java applications? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted February 10, 2017 Moderators Share Posted February 10, 2017 @Flashfires it sounds like you're trying to build a Rube Goldberg machine. Why take a screenshot, and then use X,Y coords to find the position on the application, rather than just manipulating the application? As it is a Java app, the typical control IDs are unavailable. But you should be able to use IUIAutomation (in the Examples forum). If you let us know the app, or show your screenshot, we can better assist. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Flashfires Posted February 12, 2017 Author Share Posted February 12, 2017 Hey Folks, thanks for the responses! @water Wait, you're saying AutoIT can talk to Java apps? That's a game changer ... I was convinced it couldn't. Thank you, I'll check that out! @JLogan3o13 Thanks for the IUIAutomation reference, I'll check it out. I may be over complicating things out of ignorance of the AutoIT features. I'll give this a look, and let you know how it works out either way. Thanks again! Link to comment Share on other sites More sharing options...
water Posted February 12, 2017 Share Posted February 12, 2017 I have never tried it myself. It might have its limitations but what I have read sounds promising. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
junkew Posted February 12, 2017 Share Posted February 12, 2017 Java is accessible with java access bridge and frequently iaccessible/iaccessible2 will work. Check jabsimplespy and indeed iuiautomation thread. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Flashfires Posted February 14, 2017 Author Share Posted February 14, 2017 Well, I've been trying to get the data access bridge working, but no dice. Being honest, it's probably a little over my head. As I'm running out of time to implement a solution for this, I'll check out a few of these other suggestions to see if I have any luck. To better explain my issue, I have a dropdown list in a Java application. I can click it with AutoIT, but can't read the values ... cause 'Java'. The values of the dropdown list are ever changing, as it's database driven. But a few of the values in there are constant, and those are the ones I'm interested in. For the sake of example, let's say the constant values of the dropdown list are "cat", "dog", and "Fish". I need to create a loop where I: Have AutoIT click the Dropdown List Select one of these Constant Values Do Other Stuff Repeat With no way to communicate with the dropdown list, my only thought was to take screenshots of these constant dropdown items. (Cat, Dog, Fish) My hope was to have AutoIT click the dropdown, and find the coordinates of one of these constants by using these saved screenshots. (so I can select it) If anyone knows how to do that, it might be easier for me to implement. Or if I'm being silly and there's a much easier way to accomplish this, please let me know. Link to comment Share on other sites More sharing options...
junkew Posted February 14, 2017 Share Posted February 14, 2017 (edited) What is jabsimplespy giving? Which windows version and which jdk is installed? In general advice to try trial version of ranorex spy. If that works you know controls are recognizable. if simplespy and inspect.exe do not recognize its only alternative is jabsimplespy for java objects and iaccessible interfaces for qt widgets. Edited February 14, 2017 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
spudw2k Posted February 15, 2017 Share Posted February 15, 2017 On 2/10/2017 at 0:43 PM, JLogan3o13 said: If you let us know the app, or show your screenshot, we can better assist. I second that. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Flashfires Posted February 16, 2017 Author Share Posted February 16, 2017 @JLogan3o13 @spudw2k Fair enough. I work for a hotel chain, and this app works in conjunction with our reservation system. I'm looking to see of AutoIT can automate some very repetitive and time consuming tasks. I'll provide a screenshot to give you a visual, and I'll just scratch out the sensitive data. Despite not having access to the controls (it's java) interacting with this screen is easy with AutoIT. The only issue is with the dropdown list. The problem is that rates are added and removed regularly. So you can't count on items being in the same position. The dropdown list does not accept keystrokes, so you can't just type what you're looking for. But the items I need to select are constants, so they'll always be there ... just maybe in a different position. The items are BAR1, BAR2, BAR3, etc. So unless I manage to implement java access bridge, the only way I can think to do this is to: Screen capture the above values (BAR1, BAR2, BAR3, etc) Open the dropdown list in AutoIT Use those screenshots to find and click the values Disclaimer: I'm not a pro developer ... I'm savvy enough to follow code samples, and tweak them as needed. But implementing some of the solutions so far have been over my head. I'm still trying though. I hope that helps, let me know if you need more details. Thanks for the assistance, it's much appreciated! Link to comment Share on other sites More sharing options...
junkew Posted February 16, 2017 Share Posted February 16, 2017 To be able to help more info from any spy is needed. Maybe this initially helps http://docs.oracle.com/javase/accessbridge/2.0.2/javaferret.htm FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Flashfires Posted February 17, 2017 Author Share Posted February 17, 2017 @junkew Ok, I'll take another stab at getting the Java Access Bridge working on Monday morning. Thanks for the link! 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