Micro Focus QTP (UFT) Forums

Full Version: Problem to set a data into a JavaEdit field
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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.



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.
Using the options “Use Java API” , “Send InputMethod event”, “Send FOCUS_LOST event at end”

=> This does not help

Using the option “Perform mouse/keyboard operations at device level for these selected methods:”

=> This does not help

Using the internal method of the JavaEdit instead of QTP ones

=> This does not help

Using the FireEvent method

=> This does not help

Increasing the Object Synchronisation Timeout

=> Looks like to have a good impact

Now I check the RefreshObject method