bharathsoft
Junior Member
Reged: 09/27/05
Posts: 30
Loc: Hyderabad
|
|
Hi,
When i am executing the script, I am getting the '501 - Illegal assigment'.
Can anybody help to relate this error to my script. I did lot of research on it. I am not able to get why this error comes.
If you see the attached functions and script, I am trying to call the 'Update_APP_Status', to update the status in the output data table. But here, I am getting the error stating 501-Illegal assignment error on QTP Results
Please let me know the possibilities of this error in QTP VB Script.
NOTE: Please rename the attachment as 'Library1.vbs' and then you can see the code.
Thanks a lot.
-Bharathsoftqa
|
Rajkumar_Rajangam
Veteran
Reged: 10/22/10
Posts: 3136
Loc: Norway
|
|
Can you re-attach your snapshot?
-------------------- Rajkumar
|
bharathsoft
Junior Member
Reged: 09/27/05
Posts: 30
Loc: Hyderabad
|
|
One more time...
|
Rajkumar_Rajangam
Veteran
Reged: 10/22/10
Posts: 3136
Loc: Norway
|
|
The attachment was empty in your previous post & its corrupted in second post. Try opening it yourself.
-------------------- Rajkumar
|
bharathsoft
Junior Member
Reged: 09/27/05
Posts: 30
Loc: Hyderabad
|
|
No Raj,
I am able to see the code by clicking the attachment link in the second post without any problem.
|
bharathsoft
Junior Member
Reged: 09/27/05
Posts: 30
Loc: Hyderabad
|
|
Here is the code:
Sub SCF_CreateOutputTable(strRefNo)
Dim objFSFile Set objFSFile = Createobject("Scripting.FileSystemObject") Dim strTemplateFile, strResultFile, strSheetName, intRowCount strSheetName = "Data_Output" strResultFile = g_strTestSuitePath & "\Application\" & g_strApplicationName & "\Data Definitions\" & g_strApplicationName & "_Output.xls" strTemplateFile = g_strTestSuitePath & "\Framework\Dictionary\" & g_strApplicationName & "_Output.xls" DataTable.AddSheet strSheetName If Not objFSFile.FileExists(strResultfile) Then ' To create a data sheet named User_Data DataTable.ImportSheet strTemplateFile,1,strSheetName Else DataTable.ImportSheet strResultfile,strSheetName,strSheetName End if 'DataTable.ImportSheet strTemplateFile,1,strSheetName
Dim strTempKey ' strSheetName = "Data_Output" intRowCount = DataTable.GetSheet(strSheetName).GetRowCount ' To get the total rowCount 'msgbox intRowCount For jintIndex = 1 To intRowCount 'msgbox jintIndex DataTable.SetCurrentRow( jintIndex ) strTempKey = DataTable.Value(g_strKeyColumn,strSheetName) 'msgbox strTempKey If strTempKey = strRefNo Then Exit For End If Next 'DataTable.SetCurrentRow(jintIndex) End Sub
Sub SCF_WriteDataOutput ( strKey, strFieldName, strValue )
Dim intRowCount, strSheetName, intIndex, strTempKey strSheetName = "Data_Output" intRowCount = DataTable.GetSheet(strSheetName).GetRowCount ' To get the total rowCount For intIndex = 1 To intRowCount DataTable.SetCurrentRow( intIndex ) strTempKey = DataTable.Value(g_strKeyColumn,strSheetName) If strTempKey = strKey Then Exit For End If Next DataTable.SetCurrentRow(jintIndex) ' To set the current row 'msgbox jintIndex 'msgbox g_strKeyColumn 'msgbox strKey ' msgbox strFieldName 'msgbox strValue 'DataTable.Value(g_strKeyColumn,strSheetName) = strKey DataTable.Value(strFieldName,strSheetName) = strValue End Sub
Sub SCF_SaveOutputTable()
Dim strResultFile, strSheetName strSheetName = "Data_Output" strResultFile = g_strTestSuitePath & "\Application\" & g_strApplicationName & "\Data Definitions\" & g_strApplicationName & "_Output.xls" DataTable.ExportSheet strResultFile, strSheetName End Sub
'Function to Update the captured app status into O/P Sheet. Function Update_APP_Status(strAPP_GTINoAvail, strAPPval,str_APPComment) strRefNo = g_strTCNO Call SCF_CreateOutputTable(strRefNo) Call SCF_WriteDataOutput ( strRefNo, "AD_GTI_NO", strAPP_GTINoAvail) Call SCF_WriteDataOutput ( strRefNo, "APP_Status", strAPPval) Call SCF_WriteDataOutput ( strRefNo, "Comments", str_APPComment) Call SCF_WriteDataOutput ( strRefNo, "Act_Status_APP", APP_PymtStatus) Call SCF_WriteDataOutput ( strRefNo, "Exp_Status_APP", str_ExpectedAPP) If Trim(str_ExpectedAPP)=Trim( APP_PymtStatus)Then Call SCF_WriteDataOutput ( strRefNo,"APP_FinalStatus","Pass") Else Call SCF_WriteDataOutput ( strRefNo,"APP_FinalStatus","Fail") End if Call SCF_SaveOutputTable() End Function
|
Rajkumar_Rajangam
Veteran
Reged: 10/22/10
Posts: 3136
Loc: Norway
|
|
Which function does the error occur in? There are a no. of global variables. Check if they have valid values.
-------------------- Rajkumar
|
Tarun Lalwani
Veteran
Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
|
|
Which line does the error occur?
-------------------- Regards,
Tarun
** First ever technical novel - And I thought I knew QTP! **
** Download QTP Unplugged 2nd Edition eBook for FREE **
KnowledgeInbox RSS
|
bharathsoft
Junior Member
Reged: 09/27/05
Posts: 30
Loc: Hyderabad
|
|
When I am calling the 'Update_APP_Status' function, I am getting this error.
-Bharathsoftqa
|
PriyaC_S
Member
Reged: 03/30/09
Posts: 38
|
|
Did you got some solution for the same?
|