Jump to content

Could not find Java Application control name


Recommended Posts

Hi,

I need to automate Java application using AutoIt, I have refer forum for the same, as per forum I am using Java Access Bridge to finding control name. But could not set value to control. Below is my sample code 

Send("#r")
sleep(1500)
Send("D:\javaapplication\javaapplication\Hello.jar{Enter}")
WinActivate("Penjumlahan")
sleep(1500)
ControlSetText("Penjumlahan", "", "Name:  A :", "demo")

Java Application and Java Ferret screen

image.png.96be2b7498ff92422338258b71357a91.png

Link to comment
Share on other sites

  • Replies 57
  • Created
  • Last Reply

Top Posters In This Topic

Try to use the search fonction of the forum. 

 

Search this without dot : 

IUIAutomation learning 

You will have all answer needed.

Or watch my signature.

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

7 minutes ago, Aether said:

I don't think "Name: " should be there, remove it.

Java application cannot being automated with autoit. Even with the most correct syntax he wont be able to get it work.

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

  • Moderators

@KhalidAnsari Please pay attention to where you're posting. Large difference between the Reply button and the Report button ;)

"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

1 minute ago, junkew said:

Las aplicaciones java no son accesibles con las funciones regulares de autoit.

Para eso necesitas manejarlo con el puente de accesibilidad java.

https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy

 

también ver preguntas frecuentes 31

A quick query, do you have an improved or newer version of the Spy?

Link to comment
Share on other sites

just checked source is still running fine using windows 10 and au3 3.3.14.15

>Running:(3.3.14.5)
C:\Program Files\Java\jre1.8.0_181
We are using X64 at cpu X64 Autoit 64 bit version 1
  Windows accessbridge 32 opened 1
 0 initializeAccessBridge is finishedWindows_run passed :
0hello  name: <About...>
  description: <<html>View information about this version of the JRE</html>>
  role: <push button>
  role_en_US: <push button>
  states: <enabled,focusable,visible,showing,opaque>
  states_en_US: <enabled,focusable,visible,showing,opaque>
  indexInParent: <0>
  childrenCount: <0>
  x: <1126>
  y: <277>
  width: <73>
  height: <0>

 

Link to comment
Share on other sites

Hi,

@junkew I tried this https://www.autoitscript.com/forum/topic/166830-java-object-automation-and-simple-spy 

I am using simplespy but i coud not get info apart from title name where was JFrame contain button and textbox. Is I am doing anything wrong. JAB Spy is not showing info I have already enable jabswitch. I am using windows 10 and jdk ver 1.8.

I have gone through IUIAutomation link as well.  

Please let kwn where I am going wrong. 

Thanks in advance. Below is my screen detail based on simplespy.

image.thumb.png.20af4f77354b4a484ea47c8349390aa0.png

 

Link to comment
Share on other sites

Iuiautomation will only recognize main java window and nothing inside. For jabsimplespy you should compile it first and run as exe. I have sen situations where it will not work from the ide. And probably you have to play and tweak with 32 and 64 bits jab dll. Get it first working on java configuration window.

Link to comment
Share on other sites

Hi,

@junkew  Thanks for reply.  I am using Java 64 bit. i have combile jabsimplespy then run as exe it erroring out. Stating jabsimplyspy stopped working. How can I recognize inside control of java window. i am trying Iuiautomation _UIA_getObjectByFindAll , _UIA_getText and _UIA_setText.

Thanks for helping.

Link to comment
Share on other sites

@KhalidAnsari Do you did what i said you ?

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Hi,

Thanks for reply.

Yes i did it. Still I am not able to get it. I Below is my code. I can able to set focus on title bar but i could not set focus on textbox and set value. 

Please let me kwn if am doing wrong.

Thanks

#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)
Sleep(5000)
_UIA_setVar("oP1","Title:=Penjumlahan;controltype:=UIA_WindowControlTypeId;class:=SunAwtFrame")
_UIA_setVar("oUIElement","Title:=;controltype:=UIA_TitleBarControlTypeId;class:=") ;ControlType:=UIA_TitleBarControlTypeId;classname:=")
_UIA_Action("oP1","setfocus")
_UIA_action("oUIElement","highlight")
MsgBox(0, "", "Hello")

 

Link to comment
Share on other sites

So you are able to set focus to Grand Parent > Parent > Child window ? 

 

You are able to see your item but you can't play with it ? 

You not able to see your item ?

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Can you show me ONLY the wanted control + the simplespy windows with WANTED CONTROL's simplespy information please ?

Full windows of both application please. not only a part.

 

Also when you hit CTRL+W Does the wanted control or somthing else is hightlighted ?

Edited by caramen

My video tutorials : ( In construction )  || My Discord : https://discord.gg/S9AnwHw

How to Ask Help ||  UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote

Spoiler

 Water's UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Link to comment
Share on other sites

Hi @caramen

Thanks for reply. Please help and correct me.

Below is my java screen. It has control like textbox and button. 

image.png.a9c939276a6d1d879d015a4ef93f5877.png

------------------------------------------------------------------------------------------------------------------------------------

My au3 script for setting focus and setting value in control which i could not able to find and set it.

;#RequireAdmin
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)
WinWaitActive("Penjumlahan")
Local $oP3=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Penjumlahan;controltype:=UIA_WindowControlTypeId;class:=SunAwtFrame", $treescope_children)
_UIA_Action($oP3,"setfocus")
Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=Penjumlahan;controltype:=UIA_PaneControlTypeId;class:=", $treescope_children)
_UIA_Action($oP2,"setfocus")
Local $oUIElement=_UIA_getObjectByFindAll($oP3, "title:=;ControlType:=UIA_PaneControlTypeId", $treescope_subtree)
_UIA_action($oUIElement,"highlight")
;~_UIA_action($oUIElement,"click")
;~_UIA_action($oUIElement,"setvalue", "ABCDE9999F")

----------------------------------------------------------------------------------------------------------------

Code snippet of SimpleSpy window. I cannot able to find my child control detail. When i keep my mouse pointer on control and press ctrl+w simplespy give me the detail of desktop window. 

#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

Local $oP0=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Penjumlahan;controltype:=UIA_WindowControlTypeId;class:=SunAwtFrame", $treescope_children)    
_UIA_Action($oP0,"setfocus")
;~ First find the object in the parent before you can do something
;~$oUIElement=_UIA_getObjectByFindAll(".mainwindow", "title:=;ControlType:=UIA_TitleBarControlTypeId", $treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=;ControlType:=UIA_TitleBarControlTypeId", $treescope_subtree)
;~_UIA_action($oUIElement,"highlight")
_UIA_action($oUIElement,"click")


*** Detailed properties of the highlighted element ***
UIA_iaccessiblevalue:= <Penjumlahan>
UIA_iaccessiblechildId:= <0>
UIA_handle:= <0>
UIA_RuntimeId:= <42;328950;1;-2147483647;328950;-2;0>
UIA_BoundingRectangle:= <888;197;378;23>
UIA_ProcessId:= <580>
UIA_ControlType:= <50037>
UIA_LocalizedControlType:= <title bar>
UIA_HasKeyboardFocus:= <False>
UIA_IsKeyboardFocusable:= <True>
UIA_IsEnabled:= <True>
UIA_Culture:= <0>
UIA_IsControlElement:= <True>
UIA_IsContentElement:= <False>
UIA_IsPassword:= <False>
UIA_NativeWindowHandle:= <0>
UIA_IsOffscreen:= <False>
UIA_Orientation:= <0>
UIA_IsRequiredForForm:= <False>
UIA_IsDockPatternAvailable:= <False>
UIA_IsExpandCollapsePatternAvailable:= <False>
UIA_IsGridItemPatternAvailable:= <False>
UIA_IsGridPatternAvailable:= <False>
UIA_IsInvokePatternAvailable:= <False>
UIA_IsMultipleViewPatternAvailable:= <False>
UIA_IsRangeValuePatternAvailable:= <False>
UIA_IsScrollPatternAvailable:= <False>
UIA_IsScrollItemPatternAvailable:= <False>
UIA_IsSelectionItemPatternAvailable:= <False>
UIA_IsSelectionPatternAvailable:= <False>
UIA_IsTablePatternAvailable:= <False>
UIA_IsTableItemPatternAvailable:= <False>
UIA_IsTextPatternAvailable:= <False>
UIA_IsTogglePatternAvailable:= <False>
UIA_IsTransformPatternAvailable:= <False>
UIA_IsValuePatternAvailable:= <True>
UIA_IsWindowPatternAvailable:= <False>
UIA_ValueValue:= <Penjumlahan>
UIA_ValueIsReadOnly:= <False>
UIA_RangeValueValue:= <0>
UIA_RangeValueIsReadOnly:= <True>
UIA_RangeValueMinimum:= <0>
UIA_RangeValueMaximum:= <0>
UIA_RangeValueLargeChange:= <0>
UIA_RangeValueSmallChange:= <0>
UIA_ScrollHorizontalScrollPercent:= <0>
UIA_ScrollHorizontalViewSize:= <100>
UIA_ScrollVerticalScrollPercent:= <0>
UIA_ScrollVerticalViewSize:= <100>
UIA_ScrollHorizontallyScrollable:= <False>
UIA_ScrollVerticallyScrollable:= <False>
UIA_SelectionCanSelectMultiple:= <False>
UIA_SelectionIsSelectionRequired:= <False>
UIA_GridRowCount:= <0>
UIA_GridColumnCount:= <0>
UIA_GridItemRow:= <0>
UIA_GridItemColumn:= <0>
UIA_GridItemRowSpan:= <1>
UIA_GridItemColumnSpan:= <1>
UIA_DockDockPosition:= <5>
UIA_ExpandCollapseExpandCollapseState:= <3>
UIA_MultipleViewCurrentView:= <0>
UIA_WindowCanMaximize:= <False>
UIA_WindowCanMinimize:= <False>
UIA_WindowWindowVisualState:= <0>
UIA_WindowWindowInteractionState:= <0>
UIA_WindowIsModal:= <False>
UIA_WindowIsTopmost:= <False>
UIA_SelectionItemIsSelected:= <False>
UIA_TableRowOrColumnMajor:= <2>
UIA_ToggleToggleState:= <2>
UIA_TransformCanMove:= <False>
UIA_TransformCanResize:= <False>
UIA_TransformCanRotate:= <False>
UIA_IsLegacyIAccessiblePatternAvailable:= <True>
UIA_LegacyIAccessibleChildId:= <0>
UIA_LegacyIAccessibleValue:= <Penjumlahan>
UIA_LegacyIAccessibleDescription:= <Displays the name of the window and contains controls to manipulate it>
UIA_LegacyIAccessibleRole:= <1>
UIA_LegacyIAccessibleState:= <1048576>
UIA_IsDataValidForForm:= <False>
UIA_ProviderDescription:= <[pid:6536,hwnd:0x0 Annotation:Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]>
UIA_IsItemContainerPatternAvailable:= <False>
UIA_IsVirtualizedItemPatternAvailable:= <False>
UIA_IsSynchronizedInputPatternAvailable:= <False>

Edited by KhalidAnsari
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

×
×
  • Create New...