04-15-2010, 05:21 PM
(This post was last modified: 04-19-2010, 05:22 PM by niveditachan.)
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 :
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??
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??