11-30-2010, 07:25 PM
Hi,
I am using QTP 10.0 + AddIn to simulate a java application.
To set a data into a javaedit field, I am using the following method.
Sometimes it works, sometimes not, and this with the same data and the same context.
How can I improve this code to be sure that the set will be done.
Thanks for your help.
I am using QTP 10.0 + AddIn to simulate a java application.
To set a data into a javaedit field, I am using the following method.
Sometimes it works, sometimes not, and this with the same data and the same context.
Code:
if (object.WaitProperty ("enabled", "1", 10000) and object.WaitProperty ("visible", "1", 10000)) then
object.click 0, 0
If (object.WaitProperty("focused",True, 10000) = false) then
object.click 0, 0
object.setfocus
end if
object.WaitProperty "editable",True, 10000
object.set arrKeyIndex(1)
object.Type micReturn
else
Err.raise(err_field_not_available )
Reporter.ReportEvent micFail,"Error # " & CStr(Err.Number), "Field not available"
end if
How can I improve this code to be sure that the set will be done.
Thanks for your help.