Hello everyone:

I am having problems when I compare the x,y position found using 
controlObject = 
DotNetFactory.CreateInstance("System.Windows.Forms.Control") to the usual 
method of GetROProperty("x").

I am using the url = http://www.mortgagecalculator.org/ for the study with 
IE maximized.

The code is:

browserName = "Mortgage Calculator"
pageTitle = "Mortgage Calculator"

wait 5 ''// waiting 5 seconds to give me time to place the cursor just to 
the left of the interest rate edit box after clicking on the web edit 
interest rate field

''// http://snipplr.com/view/52362/get-cursor-position-in-qtp/
''// GetCursorPositionInQTP
Dim controlObject
Dim currentX, x
Dim currentY, y
Set controlObject = 
DotNetFactory.CreateInstance("System.Windows.Forms.Control")
wait 5

currentX = controlObject.MousePosition.X
currentY = controlObject.MousePosition.Y

print "dotnet, x,y = " & currentx &","&currenty
x = Browser("name:="& browserName).page("title:="& 
pageTitle).WebEdit("name:=param\[interest_rate\]").GetROProperty("x") 
y = Browser("name:="& browserName).page("title:="& 
pageTitle).WebEdit("name:=param\[interest_rate\]").GetROProperty("y")

print "x,y = " & x &","& y
x_ab = Browser("name:="& browserName).page("title:="& 
pageTitle).WebEdit("name:=param\[interest_rate\]").GetROProperty("abs_x") 
y_ab = Browser("name:="& browserName).page("title:="& 
pageTitle).WebEdit("name:=param\[interest_rate\]").GetROProperty("abs_y")
print "abs: x,y = " & x &","& y

''// retrives the name of the object that has focus
print Browser("name:="& browserName).page("title:="& 
pageTitle).object.activeElement.name

''// clear the value
Browser("name:="& browserName).page("title:="& 
pageTitle).Object.elementFromPoint(x,y).value = ""


Typical values on my computer are:
dotnet, x,y = 443,745
x,y = 446,632
abs: x,y = 446,632
I do not understand why there is approximately a difference of 110 between 
the dotnet y value and the GetROProperty("y") value.
The dotNet y value does not work with the elementFromPoint line while 
the GetROProperty("y") value works as expected.
 
Any and all help would be appreciated.
 
Thanks,
 
Parke

-- 
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to