Highlighted
New Member.
4450 views

LoadRunner 12.53 : lr_xml_get_values not able to find matched item from xml

Jump to solution

Hi ,

I am using Silverlight Protocol.I am having a problem while executing the script I had prepared on LR12.00.The function lr_xml_get_values was generated simply by right clicking on the response.

To simplify I am just posting step where the issue is happening.

	lr_xml_get_values("XML=<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">"
	                  "<s:Body><GetTaskListResponse xmlns=\"http://www.clicksoftware.com\">" 
	                  "<OrderedTasksKeys><Key>985553452</Key><Key>985553461</Key></OrderedTasksKeys>" 
	                  "<PageType>Last</PageType><DatabaseCaseSensitive>1</DatabaseCaseSensitive>" 
	                  "<TotalTasks>0</TotalTasks></GetTaskListResponse></s:Body></s:Envelope>",
	                  "Query=/Envelope[1]/Body[1]/GetTaskListResponse[1]/OrderedTasksKeys[1]/Key[1]/text()[1]",
	                  "ValueParam=p_out",
	                  LAST);

 

In LoadRunner 12.00 version this is working fine but this is not working in LR 12.53 and giving error as :

Starting action Action.
Action.c(4): Error: No matches were found for the specified query: "/Envelope[1]/Body[1]/GetTaskListResponse[1]/OrderedTasksKeys[1]/Key[1]/text()[1]".
Action.c(4): Error: "lr_xml_get_values" execution failed
Ending action Action.

I am not able to find the cause.

I am using LR 12.53 Patch 1 on Windows Server 2012 R2.

While creating a new Silverlight script it just includes globals.h (same is there for LR12..00).Do I require any more header file to include ? Please help.

Attaching the screenshots from both 12.00 and 12.53 Versions.

 

 

 

0 Likes
1 Solution

Accepted Solutions
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: LoadRunner 12.53 : lr_xml_get_values not able to find matched item from xml

Jump to solution

 

Hello,

Please update to LR_12.53_patch3, in this version, We've add the backward compatibility support for the old way XPath.

Regards,

Bingle 

View solution in original post

7 Replies
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: LoadRunner 12.53 : lr_xml_get_values not able to find matched item from xml

Jump to solution

Hello, 

In 12.53, we did some update to the xml functions to make it follow the standard, you can use this query: 

"Query=/s:Envelope[1]/s:Body[1]/*[local-name()='GetTaskListResponse'][1]/*[local-name()='OrderedTasksKeys'][1]/*[local-name()='Key'][1]/text()[1]",

You can also select the value in snapshot view, right click and select create parameter  to re-generate the query string. 

Regards,

Bingle(LoadRunner R&D)

Highlighted
New Member.

Re: LoadRunner 12.53 : lr_xml_get_values not able to find matched item from xml

Jump to solution

Hi Bingle,

Thanks a lot.Your solution has worked fine.
However , On Right Click option , it is still generating xpath like older LR versions.
Is there any way to generate the xpath as your provided syntax ?
There are so many scripts and have to manually replace the xpath under this situation.

Functions generated on Right Click :

Response message for the Silverlight SOAP request is :

<s:Envelope xmlns:s = "http://schemas.xmlsoap.org/soap/envelope/" >
<s:Body>
<GetTaskListResponse xmlns = "http://www.clicksoftware.com" >
<OrderedTasksKeys>
<Key>984073704</Key>
<Key>984073705</Key>
<Key>984073706</Key>
</OrderedTasksKeys>
<PageType>Last</PageType>
<DatabaseCaseSensitive>1</DatabaseCaseSensitive>
<TotalTasks>0</TotalTasks>
</GetTaskListResponse>
</s:Body>
</s:Envelope>

Below are the functions generated on Right Click option :

lr_xml_extract("XML={response}",
"Query=/Envelope[1]/Body[1]/GetTaskListResponse[1]/OrderedTasksKeys[1]/Key[1]/text()[1]",
"XMLFragmentParam=ParamXml_string",
LAST);

lr_xml_get_values("XML={response}",
"Query=/Envelope[1]/Body[1]/GetTaskListResponse[1]/OrderedTasksKeys[1]/Key[1]/text()[1]",
"ValueParam=ParamValue_string",
LAST);

Attached screenshot for the Right Click option.


0 Likes
Highlighted
Frequent Contributor.
Frequent Contributor.

Re: LoadRunner 12.53 : lr_xml_get_values not able to find matched item from xml

Jump to solution

 

Hello,

Please update to LR_12.53_patch3, in this version, We've add the backward compatibility support for the old way XPath.

Regards,

Bingle 

View solution in original post

Highlighted
New Member.

Re: LoadRunner 12.53 : lr_xml_get_values not able to find matched item from xml

Jump to solution

Hi Bingle,

Thanks a lot for the resolution.

0 Likes
Highlighted
New Member.

Re: LoadRunner 12.53 : lr_xml_get_values not able to find matched item from xml

Jump to solution

<S:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><S:Body><GetNotificationHistoryResponse xmlns="http://edd.att.com/cnmeddhistory" xmlns:ns0="http://cio.att.com/commonheader/v3"><trasactionKey>-1777827609</trasactionKey><returnData></returnData></GetNotificationHistoryResponse></S:Body></S:Envelope>

I want to extract the "trasactionKey" value in the above xml

but by below function not getting the proper output


lr_xml_get_values("XML={response}",
                         "ValueParam=trasaction_key",
                         "Query=/S:Envelope/S:Body/GetNotificationHistoryResponse/trasactionKey",
                         LAST);


Please help me the proper Query value to be given.

 

Thanks,

Shashank

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: LoadRunner 12.53 : lr_xml_get_values not able to find matched item from xml

Jump to solution

We are experiencing the same problem.    We are trying to have the Extract all of the occurences of a certain element.  IN this case we are looking to get the list of lead IDS

 

 

 

        "Query=/soap:Envelope[1]/soap:Body[1]/*[local-name()='GetLeadInfoListResponse'][1]/*[local-name()='GetLeadInfoListResult'][1]/*[local-name()='LeadInfo'][1]/*[local-name()='LeadID'][1]",

0 Likes
Highlighted
Contributor.
Contributor.

Re: LoadRunner 12.53 : lr_xml_get_values not able to find matched item from xml

Jump to solution

I need to capture some value response data and store that value in the external file (CSV) , so that i can use that value in next another script.

 

The following is the response:

parameter "response" =  "emas.xmlsoap.org/soap/envelope/"><soap-env:Header/><soap-env:Body><n0:CurrentAccountContractFSCreateConfirmation_V2 xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:BSR:/1SAI/TAE1F6F38D982B9E8BE454B:750"><MessageHeader><ID>005056B5D69F1EE88EB288EBE491B361</ID><UUID>005056b5-d69f-1ee8-8eb2-88ebe491b361</UUID><ReferenceUUID>4d6a6150-176c-11e1-bddb-0756300c9a66</ReferenceUUID><CreationDateTime>2018-04-06T12:16:05Z</CreationDateTime><SenderBusinessSystemID>BAS_BSR_300</SenderBusinessSystemID></MessageHeader><CurrentAccountContract><ID schemeID="BAC.002c" schemeAgencyID="310">00000010748784049                  679000         ZA</ID><ChangeStateID>                 20180406121605.1053140</ChangeStateID><SystemAdministrativeData><CreationDateTime>2018-04-06T12:16:05Z</CreationDateTime><LastChangeDateTime>2018-04-06T12:16:05Z</LastChangeDateTime><LastChangeUserAccountID schemeAgencyID="310">A100309</LastChangeUserAccountID></SystemAdministrativeData><CurrencyCode>ZAR</CurrencyCode><LifeCycleStatusCode>2</LifeCycleStatusCode><LifeCycleStatusName languageCode="en">Active</LifeCycleStatusName><StartDate>2018-03-29</StartDate><UsageNote>TransactionalAccount</UsageNote><DormancyStatusCode listVersionID="11439" listAgencyID="310">01</DormancyStatusCode><DormancyStatusName languageCode="en">Active</DormancyStatusName><OperationalBankContractManagement><ValidityPeriod/><CurrentIndicator>true</CurrentIndicator><ID>50000000</ID></OperationalBankContractManagement><BusinessProcessChainAssignment><BusinessProcessChainUUID>b9331efe-c68f-4a4e-9e1d-de097049e036</BusinessProcessChainUUID><BankingBusinessTransactionTypeCode listID="10924" listAgencyID="310">300001</BankingBusinessTransactionTypeCode><BankingBusinessTransactionTypeName languageCode="E ">CREATION (DEPOSIT)</BankingBusinessTransactionTypeName></BusinessProcessChainAssignment><AccountHolderParty><ValidityPeriod/><CurrentIndicator>true</CurrentIndicator><IdentifyingElements><PartyKey><PartyTypeCode>147</PartyTypeCode><PartyID>3000006738</PartyID></PartyKey><PartyUUID>005056b5-2a40-1ed8-8c99-c519410e8eee</PartyUUID></IdentifyingElements></AccountHolderParty><Product><ValidityPeriod/><CurrentIndicator>true</CurrentIndicator><BankAccountContractProductionControl><ID>Z_DSYCA001</ID><Version><ID>0036</ID></Version></BankAccountContractProductionControl><BankSalesProduct><ID>D001</ID></BankSalesProduct></Product><BankAccount><ValidityPeriod/><CurrentIndicator>true</CurrentIndicator>

<IdentifyingElements><ID>00000010748784049</ID><InternalID schemeAgencyID="310">EBE49188D3611EE88EB2005056B5D69F</InternalID><Bank><RoutingID>679000</RoutingID><CountryCode>ZA</CountryCode><CountryName languageCode="en">South Africa</CountryName></Bank></IdentifyingElements></BankAccount></CurrentAccountContract><Log><BusinessDocumentProcessingResultCode>3</BusinessDocumentProcessingResultCode></Log></n0:CurrentAccountContractFSCreateConfirmation_V2></soap-env:Body></soap-env:Envelope>"

 

The following Query I am using to  Extract the ID value: 00000010748784049, but not getting the value.

Kindly help with Query Xpath .

 

 

//extract InternalID from XML
lr_xml_get_values("XML={response}",
          "ValueParam=InternalID",
          "Query=/Envelope/env:Body/n0:CurrentAccountContractFSCreateConfirmation_V2/BankAccount/IdentifyingElements/ID",
          LAST );

//check if InternalID was extracted
lr_output_message( "InternalID= %s", lr_eval_string( "{InternalID}" ) );

 

Using the above Query to extract the highligted ID, But value not extracted.

 

Kindly advise me

 

 

0 Likes
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.