The online community for software testing & quality assurance professionals
 
 
Calendar   Today's Topics
Sponsors:
Lost Password?

Home
BetaSoft
Blogs
Jobs
Training
News
Links
Downloads



Testing Tools >> HP Functional Testing / Mercury QuickTest Pro / QTP

Pages: 1
bharathsoft
Junior Member


Reged: 09/27/05
Posts: 30
Loc: Hyderabad
501-Illegal assignment error on QTP Results
      #693220 - 12/12/11 12:03 AM Attachment (90 downloads)

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Rajkumar_RajangamModerator
Veteran


Reged: 10/22/10
Posts: 3136
Loc: Norway
Re: 501-Illegal assignment error on QTP Results [Re: bharathsoft]
      #693222 - 12/12/11 12:31 AM

Can you re-attach your snapshot?

--------------------
Rajkumar


Post Extras: Print Post   Remind Me!   Notify Moderator  
bharathsoft
Junior Member


Reged: 09/27/05
Posts: 30
Loc: Hyderabad
Re: 501-Illegal assignment error on QTP Results [Re: Rajkumar_Rajangam]
      #693226 - 12/12/11 01:40 AM Attachment (95 downloads)

One more time...

Post Extras: Print Post   Remind Me!   Notify Moderator  
Rajkumar_RajangamModerator
Veteran


Reged: 10/22/10
Posts: 3136
Loc: Norway
Re: 501-Illegal assignment error on QTP Results [Re: bharathsoft]
      #693227 - 12/12/11 02:01 AM

The attachment was empty in your previous post & its corrupted in second post. Try opening it yourself.

--------------------
Rajkumar


Post Extras: Print Post   Remind Me!   Notify Moderator  
bharathsoft
Junior Member


Reged: 09/27/05
Posts: 30
Loc: Hyderabad
Re: 501-Illegal assignment error on QTP Results [Re: Rajkumar_Rajangam]
      #693228 - 12/12/11 02:07 AM

No Raj,

I am able to see the code by clicking the attachment link in the second post without any problem.


Post Extras: Print Post   Remind Me!   Notify Moderator  
bharathsoft
Junior Member


Reged: 09/27/05
Posts: 30
Loc: Hyderabad
Re: 501-Illegal assignment error on QTP Results [Re: bharathsoft]
      #693229 - 12/12/11 02:09 AM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
Rajkumar_RajangamModerator
Veteran


Reged: 10/22/10
Posts: 3136
Loc: Norway
Re: 501-Illegal assignment error on QTP Results [Re: bharathsoft]
      #693232 - 12/12/11 03:12 AM

Which function does the error occur in? There are a no. of global variables. Check if they have valid values.

--------------------
Rajkumar


Post Extras: Print Post   Remind Me!   Notify Moderator  
Tarun LalwaniModerator
Veteran


Reged: 07/21/05
Posts: 15329
Loc: Milwaukee, Wisconsin
Re: 501-Illegal assignment error on QTP Results [Re: Rajkumar_Rajangam]
      #693609 - 12/14/11 01:53 PM

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


Post Extras: Print Post   Remind Me!   Notify Moderator  
bharathsoft
Junior Member


Reged: 09/27/05
Posts: 30
Loc: Hyderabad
Re: 501-Illegal assignment error on QTP Results [Re: Tarun Lalwani]
      #694364 - 12/27/11 04:58 AM

When I am calling the 'Update_APP_Status' function, I am getting this error.

-Bharathsoftqa


Post Extras: Print Post   Remind Me!   Notify Moderator  
PriyaC_S
Member


Reged: 03/30/09
Posts: 38
Re: 501-Illegal assignment error on QTP Results [Re: bharathsoft]
      #694679 - 01/03/12 12:44 AM

Did you got some solution for the same?

Post Extras: Print Post   Remind Me!   Notify Moderator  
Pages: 1



Extra information
0 registered and 112 anonymous users are browsing this forum.

Moderator:  IanFraser, Rajkumar_Rajangam, thorwath, TReddy, AJ, Tarun Lalwani, mwsrosso 

Print Topic

Forum Permissions
      You cannot start new topics
      You cannot reply to topics
      HTML is disabled
      UBBCode is enabled

Rating:
Topic views: 2844

Rate this topic

Jump to

Contact Us | Privacy statement SQAForums

Powered by UBB.threads™ 6.5.5