Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I am tring to get the coordinates of a variable
#1
I am tring to get the coordinates of a variable located in a window.

left xm((win("Offline Admin Tool" "javax.swing.JFrame") linkName) ym((win("Offline Admin Tool" "javax.swing.JFrame") linkName)

Is this close?


"linkName" is the dynamic string I wish to click
#2
When you say "variable", you probably want to say "control"? Controls are those various small fields in windows. They are also accessible objects.

Open the Find Accessible Object dialog, drag the Drag picture and drop it onto the object. Click Test to ensure that the correct object is found. Then replace the Name field with (linkName) and click OK. Then open the Accessible Object Actions dialog and select the Get Location action from the list. Of, course, you don't need to get location if you just want to click it.

You need at least QM 2.1.6.

Example code that is inserted by these two dialogs:

Code:
Copy      Help
Acc a=acc(linkName "TEXT" "Offline Admin Tool" "Internet Explorer_Server" "" 0x1801 0x40 0x20000040)
int x y cx cy
a.Location(x y cx cy)

This code finds the object and stores its coordinates into the variables x, y, cx and cy.
#3
Thanks for your help but I was unable to make it work. As you can see from the code below, I am enumerating thru a folder called "completed" crating two list folderN and fileN. The problem I need to click or set focus back to the folderN before I create the fileN.

Any ideals?



Dir d; str sPath;

str fileN
str folderN


foreach(d "C:\berklineNew\customeDocs\Completed\*" FE_Dir)
sPath=d.FileName(1)
fileN.getfilename(sPath)
folderN.getfilename(sPath)

out sPath
out folderN
out fileN

int w1=act(win("Offline Admin Tool" "javax.swing.JFrame"))
lef 0.063 0.238 w1 1
lef 0.045 0.054 w1 1
lef 0.477 0.536 win("" "SunAwtWindow") 1
act w1
lef+ 0.360 0.470 w1 1
lef- 0.130 0.474 w1 1
outp folderN
Acc a=acc("Offline Admin Tool" "CLIENT" "Offline Admin Tool" "javax.swing.JFrame" "" 0x1001)
AccClick("Offline Admin Tool" "CLIENT" "Offline Admin Tool" "javax.swing.JFrame" "folderN" 0x1005)
Acc a=acc("Offline Admin Tool" "CLIENT" "Offline Admin Tool" "javax.swing.JFrame" "" 0x1001)
int x y cx cy
a.Location(x y cx cy)

out a.Location(x y cx cy)
lef 0.927 0.904 w1 1
lef 0.071 0.322 w1 1
lef 0.047 0.044 w1 1
lef 0.459 0.783 win("" "SunAwtWindow") 1
act w1
lef+ 0.384 0.594 w1 1
lef- 0.216 0.582 w1 1
outp fileN
lef 0.904 0.540 w1 1
int w2=wait(5 win("Open" "SunAwtDialog"))
outp sPath
lef 0.903 0.860 w2 1
act w1
lef 0.940 0.899 w1 1
break


Forum Jump:


Users browsing this thread: 1 Guest(s)