KhalidAnsari Posted August 17, 2019 Posted August 17, 2019 (edited) Hi, I am trying to set value in JTextField and click button in java application. I got JAB working. please refer below. I searched on forum related Java.au3. (_JavaObjValueGet) as well. Apart from setting focus on Java screen. i could not move forward. private JButton btnClose = new JButton("Close"); private JButton btnAdd = new JButton("Add"); private JTextField txtA = new JTextField(); private JTextField txtB = new JTextField(); private JTextField txtC = new JTextField(); ;#RequireAdmin #include "UIAWrappers.au3" #include "Java.au3" AutoItSetOption("MustDeclareVars", 1) ;MsgBox("","Hello","Hello") 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) ;MsgBox("","Hello",$oP2) _UIA_Action($oP2,"setfocus") Edited August 17, 2019 by KhalidAnsari include java textbox and button code
junkew Posted August 18, 2019 Posted August 18, 2019 (edited) Uia and jab are 2 independent technologies so do only mix wgen you understand what you are doing. Did you find jabsimplespy thread?. Edited August 18, 2019 by junkew FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets
KhalidAnsari Posted August 19, 2019 Author Posted August 19, 2019 Yes I have seen the post of Jab simplespy. When i set focus on my application n press ctrl+w i get info related to title window only. Please refer image below When i keep my focus on text box of application. Press ctrl+ w focus goes to enitre monitor screen.
KhalidAnsari Posted August 19, 2019 Author Posted August 19, 2019 I have refer FAQ 31 and Download accessbridgeexplorer based on that I am getting following out put. Java Home: C:\Program Files\Java\jre1.8.0_221 We are using OS X64 at cpu X64; Autoit 64 bit version @AutoItX64=0 PASS: Windows accessbridge WindowsAccessBridge-32.dll opened returns: 1 0 Windows_run returns: _JAB_singleAction: Only applicable for single action element like button or check box, menu, menu item Code : #include "UIAWrappers.au3" #include "JavaInclude.au3" global $wintitle = "Penjumlahan" $winHandle = WinActivate($wintitle) $result = __isJavaWindow($winHandle) Sleep(5000) Global $vmId Global $ac global $sName = "Add" global $sRole = "push button" __getAccessibleContextFromHWND($winHandle, $vmID, $ac) ;$re_ac = _JAB_getAccessibleContextByFindAll($vmId, $ac, $sName, $sRole) // This line closing Java application. ;_JAB_singleAction($vmId, $re_ac) _JAB_singleAction("push button:Add", "click") Not click on button getting below line. _JAB_singleAction: Only applicable for single action element like button or check box, menu, menu item
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