Micro Focus QTP (UFT) Forums
QTP resets values of certain fields, while running (Code attached) - 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: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: QTP resets values of certain fields, while running (Code attached) (/Thread-QTP-resets-values-of-certain-fields-while-running-Code-attached)



QTP resets values of certain fields, while running (Code attached) - niveditachan - 04-15-2010

I am facing a strange problem with the QTP scripts.
The script populates certain text box fields in a page. However while running, it writes those values in the textbox and then deletes it , before moving to the next step. Thus the script fails.
Also this happens on specific systems only. It works fine on one system.
I am running these scripts from QC9.2. The QTP version is 9.5

The function is as follows :

Code:
Public Function EditField(ApplName, FieldName, Indeks, FieldDesc, FieldValue)
   Dim TextToFind
   Dim EditFelt
   Dim Knappen
   Dim MyApplication
  
If FieldValue <> IGNORE_TXT Then
    Set MyApplication = Description.Create()            
    MyApplication("text").value = ApplName & "*.*"
    
    Set EditFelt = Description.Create()
    EditFelt("swfname").Value = FieldName
    EditFelt("index").Value =  Indeks

    SwfWindow(MyApplication).Activate

if SwfWindow(MyApplication).SwfEdit(EditFelt).exist(0) then


    SwfWindow(MyApplication).SwfEdit(EditFelt).Set FieldValue
    SwfWindow(MyApplication).Type micTab

TextToFind = SwfWindow(MyApplication).SwfEdit(EditFelt).GetROProperty("text")
     EditField =TextToFind

else
Call ReportBitmap( Null, micFail,  "Editfield : " & FieldDesc & " was not found")
end if

end if

End Function


The EditField 'Editfelt' is set to FieldValue, as mentioned in the script. But just after populating this field, the script resets it again to the default value or blank and then moves on to the next step.

Any ideas??


RE: QTP resets values of certain fields, while running (Code attached) - anshika.agarwal - 02-04-2015

Hello,

I am facing a similar problem but mine is a web application, on button click all the information entered is getting reset to blank.
Can you please help if you find any solution for this?

Thanks,
Anshika