Highlighted
Absent Member.
Absent Member.
1428 views

Vugen replay error Error -205177: SyntaxError: JSON.parse for TruClient script

Upgraded from LR12.02 to LR12.5.  A TruClient script that was working prior to the upgrade shows this error during load test mode replay:

Virtual User Script started at : 2015-11-11 15:43:19
t=00003447ms: Error -205177: SyntaxError: JSON.parse: unexpected character at line 4 column 10 of the JSON data
undefined
Exception in JSON.parse in TC_NS.Ident cons , text:
{
"primaryScore":0,
"implData":{
"value":undefined
}
} [MsgId: MERR-205177]
t=00004551ms: Error -205177: SyntaxError: JSON.parse: unexpected character at line 4 column 10 of the JSON data
undefined
Exception in JSON.parse in TC_NS.Ident cons , text:
{
"primaryScore":0,
"implData":{
"value":undefined
}
} [MsgId: MERR-205177]
t=00004573ms: Error -205177: SyntaxError: JSON.parse: unexpected character at line 4 column 10 of the JSON data
undefined
Exception in JSON.parse in TC_NS.Ident cons , text:
{
"primaryScore":0,
"implData":{
"value":undefined
}
} [MsgId: MERR-205177]
Starting action Init.
TruClient Replay for LoadRunner 12.50.0, build 1096. OS: Windows 2008 R2, Browser: Firefox, initialized on 2015/11/11 at 15:43:16 (0000.000s)

The script continues to run, but I am concerned about this message.  No idea where this is coming from or why.  Is it because LR12.02 used a different TruClient protocol version?  Is it associated with the script itself (e.g. config)?

0 Likes
5 Replies
Highlighted
Honored Contributor.. Honored Contributor..
Honored Contributor..

It is due to syntax error in your request. Is it manually working? If it is encoded value, make sure that you are using DFE.


Thank you,
NaveenKumar Namachivayam | www.QAInsights.com
Learn TruWeb - my Udemy Course "Performance Testing using TruWeb" | https://www.udemy.com/performance-testing-using-truweb/?couponCode=YOUTUBE
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Please open a support case on this matter

0 Likes
Highlighted
New Member.

Same issue here.

 

t=00783525ms: Error -205177: SyntaxError: JSON.parse: unexpected character at line 4 column 10 of the JSON data
undefined
Exception in JSON.parse in TC_NS.Ident cons , text:
{
"primaryScore":0,
"implData":{
"value":undefined
}
} Snapshot Info [MSH undefined 0] [MsgId: MERR-205177]

 

 

Is thre  a sulotion for this one ?

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi Fannyz,

There is error in  JSON data

Replace "value":undefined   with "value":1

Check the JSON format for syntax error using http://json.parser.online.fr/

Example : 

{
"primaryScore":0,
"implData":{
"value":1
}
}

Solution : Code implementation needs to be changed . Instead of "undefined" code should return empty or some constant value.

 

Old JSON : 

{
"primaryScore":0,
"implData":{
"value":undefined
}
}

 

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

I faced the same error in my truclient script today. After spending some time in debugging the issue, was able to fix it.

 Where’s the issue:

 Going to the script folder location, search for the xml file, default.xml (this file contains all the test objects used in the script).

 Search the file for the text “undefined”. You might have one or more test objects with "value":undefined, like,

 </ident><ident type="JavaScript"><![CDATA[{

"primaryScore":0,

"implData":{

          "value":undefined

}

 

Reason:

 There are several reasons this could have happened. Some, I assume, are;

  • If the original script was developed in a different version
  • While juggling between the xpath, javascript or automatic in object recognition (in the ID Method: of the object) and forgetting to define the javascript value.
  • Whilst repeated disabling and enabling the steps

 

Solution:

 There are a few options to resolve this;

  • Find the object in the script steps and define the appropriate javascript value in the object ID:Method
  • In the default.xml value update the value to “value”:”” (instead of undefined)
  • If you are not using the javascript to identify the object then delete the piece of code
  • If you are not using the object itself in the script then delete the whole object properties description method
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.