Micro Focus QTP (UFT) Forums
Problem to set a data into a JavaEdit field - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Problem to set a data into a JavaEdit field (/Thread-Problem-to-set-a-data-into-a-JavaEdit-field)



Problem to set a data into a JavaEdit field - bwillems - 11-30-2010

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.


RE: Problem to set a data into a JavaEdit field - bwillems - 12-02-2010

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