Highlighted
Visitor.
345 views

XML Issue IN Flex Script Vugen and HP BPM Vugen version 12.02

Hi Team,

  I have recorded flex based applicaiton using Flex Protocol, Script is working  fine without any issues, I need to record a report in the applicaiton  , During recording i could not see any issues ,  during reply also script is workign fine,  But application found that Script is not able  Open the report.  They told that

Script is Passing correct XML But Format of XML is in Single line which causing the error,,

Is there any way to handle in Vugen to pass XML in the format which applicaiton is required, Please find the XML below.

Expected format of XML which is generated at application END which is required 

<spec platformName="MediaView"
productName="DRM"
productVersion="239558"
reportType="Standard"
reportTypeVersion="2.0"
jobName="drm-standard_metrics_monitoring_report"
specGUID="A7EC4986-2FAB-F07A-1FDD-A92E750D77DB"
specName="drm-standard_metrics_monitoring_report"
contextInfo="AU"
layout="StandardMetrics">
<prompt uiKey="ReportLayout" label="ReportLayout"
name="ReportLayout">
<selection label="ReportLayout"
summaryDetail="ReportLayout">
<item label="Standard Metrics"
type="ReportLayout"
value="StandardMetrics">
</item>
</selection>
</prompt>
<prompt uiKey="Sample" label="Sample"
name="Sample">
<selection label="Measurement Interval"
summaryDetail="Measurement Interval">
<item label="Dec 2016"
type="Measurement Interval"
value="1302016412">
</item>
</selection>
<selection label="Country"
summaryDetail="Country">
<item label="Australia"
type="Country"
value="32">
</item>
</selection>
<selection label="Platform"
summaryDetail="Platform">
<item label="Total"
type="Platform"
value="6">
</item>
</selection>
<selection label="Audience"
summaryDetail="Audience">
<item label="Not Applicable"
type="Audience"
value="-1">
</item>
</selection>
<selection label="Product"
summaryDetail="Product">
<item label="surfing"
type="Product"
value="2">
</item>
</selection>
</prompt>
<prompt uiKey="Entities" label="Entities"
name="Entities">
<selection label="Selected Items Panel"
summaryDetail="Entities">
<option label="includeSet"
type="includeSet">
<entry key="AdSupported" value="false"/>
<entry key="CensusEnabled" value="false"/>
<entry key="RegularEntity" value="true"/>
<entry key="VanEntity" value="false"/>
<entry key="Application" value="true"/>
<entry key="Drilldown" value="true"/>
</option>
</selection>
<selection label="Google"
summaryDetail="Entities">
<item label="Google"
type="Parent"
value="16821">
</item>
</selection>
<selection label="Facebook"
summaryDetail="Entities">
<item label="Facebook"
type="Parent"
value="1240714">
</item>
</selection>
</prompt>
<prompt uiKey="DRM_Target" label="Target"
name="Target">
<selection label="Target Selection"
summaryDetail="Target">
</selection>
</prompt>
<prompt uiKey="DRM_METRICS" label="Statistics"
name="Statistics">
<selection label="Unique Audience (000)"
summaryDetail="Statistics">
<item label="Unique Audience (000)"
type="Statistics"
value="5123">
</item>
</selection>
<selection label="Active Reach (%)"
summaryDetail="Statistics">
<item label="Active Reach (%)"
type="Statistics"
value="5109">
</item>
</selection>
<selection label="Universe Reach (%)"
summaryDetail="Statistics">
<item label="Universe Reach (%)"
type="Statistics"
value="5112">
</item>
</selection>
<selection label="Page Views (000)"
summaryDetail="Statistics">
<item label="Page Views (000)"
type="Statistics"
value="5139">
</item>
</selection>
<selection label="Page Views Per Person"
summaryDetail="Statistics">
<item label="Page Views Per Person"
type="Statistics"
value="5118">
</item>
</selection>
<selection label="Page Views Share (%)"
summaryDetail="Statistics">
<item label="Page Views Share (%)"
type="Statistics"
value="5140">
</item>
</selection>
<selection label="Seconds Per Page View"
summaryDetail="Statistics">
<item label="Seconds Per Page View"
type="Statistics"
value="5141">
</item>
</selection>
<selection label="Minutes Per Session"
summaryDetail="Statistics">
<item label="Minutes Per Session"
type="Statistics"
value="5119">
</item>
</selection>
<selection label="Sessions Per Person"
summaryDetail="Statistics">
<item label="Sessions Per Person"
type="Statistics"
value="5121">
</item>
</selection>
<selection label="Total Sessions (000)"
summaryDetail="Statistics">
<item label="Total Sessions (000)"
type="Statistics"
value="5114">
</item>
</selection>
<selection label="Time Per Person (hh:mm:ss)"
summaryDetail="Statistics">
<item label="Time Per Person (hh:mm:ss)"
type="Statistics"
value="5110">
</item>
</selection>
<selection label="Time Spent Share (%)"
summaryDetail="Statistics">
<item label="Time Spent Share (%)"
type="Statistics"
value="5138">
</item>
</selection>
<selection label="Total Minutes (000)"
summaryDetail="Statistics">
<item label="Total Minutes (000)"
type="Statistics"
value="5117">
</item>
</selection>
</prompt>
<outputDefinition>
<queryDef>
<query type="CREATE"
key="output0">
<sqlId>createStandardReport</sqlId>
<nsMapper>com.nielsen.media.mediaView.drm.StandardMapper</nsMapper>
</query>
<query type="COUNT"
key="">
<sqlId>countStandardReport</sqlId>
<nsMapper>com.nielsen.media.mediaView.drm.StandardMapper</nsMapper>
</query>
<query type="RETRIEVE"
key="">
<sqlId>retrieveStandardReport</sqlId>
<nsMapper>com.nielsen.media.mediaView.drm.StandardMapper</nsMapper>
</query>
</queryDef>
<layoutDef factory="com.nielsen.media.mediaView.drm.layout.factory.DRMLayoutFactoryImpl">
<layout default="false">
<displayName tag="drm.layouts.stdMetrics.displayName">Standard Metrics</displayName>
<componentName>StandardMetrics</componentName>
<componentVersion>1.0</componentVersion>
<properties>
<property key="associatedPrompts">Sample,Entities,DRM_Target,DRM_METRICS</property>
</properties>
</layout>
</layoutDef>
<exportDef>
<export outputType="EXCEL_2007" factory="com.nielsen.media.mediaView.drm.export.factory.DRMExportTaskFactory" uiCompatible="true" autoGenerate="true" default="false">
<property key="exportRequest.outputFilename"><![CDATA[{reportName}]]></property>
<property key="contextLocation"><![CDATA[/WEB-INF/export/DRMExportTaskContext.xml]]></property>
</export>
<export outputType="CSV" factory="com.nielsen.media.mediaView.drm.export.factory.DRMExportTaskFactory" uiCompatible="true" autoGenerate="true" default="false">
<property key="exportRequest.outputFilename"><![CDATA[{reportName}]]></property>
<property key="contextLocation"><![CDATA[/WEB-INF/export/DRMExportTaskContext.xml]]></property>
</export>
</exportDef>
</outputDefinition>
</spec>


XML Input by the Vugen Tool which shows in SIngle Line

<spec platformName="MediaView"productName="DRM"productVersion="239558"reportType="Standard"reportTypeVersion="2.0"jobName="drm-standard_metrics_monitoring_report"specGUID="24C7895D-D5A0-CF9D-0BCC-84504BD0ED68"specName="drm-standard_metrics_monitoring_report"contextInfo="AU"layout="StandardMetrics"><prompt uiKey="ReportLayout" label="ReportLayout"name="ReportLayout"><selection label="ReportLayout"summaryDetail="ReportLayout"><item label="Standard Metrics"type="ReportLayout"value="StandardMetrics"></item></selection></prompt><prompt uiKey="Sample" label="Sample"name="Sample"><selection label="Measurement Interval"summaryDetail="Measurement Interval"><item label="Dec 2016"type="Measurement Interval"value="1302016412"></item></selection><selection label="Country"summaryDetail="Country"><item label="Australia"type="Country"value="32"></item></selection><selection label="Platform"summaryDetail="Platform"><item label="Total"type="Platform"value="6"></item></selection><selection label="Audience"summaryDetail="Audience"><item label="Not Applicable"type="Audience"value="-1"></item></selection><selection label="Product"summaryDetail="Product"><item label="surfing"type="Product"value="2"></item></selection></prompt><prompt uiKey="Entities" label="Entities"name="Entities"><selection label="Selected Items Panel"summaryDetail="Entities"><option label="includeSet"type="includeSet"><entry key="AdSupported" value="false"/><entry key="CensusEnabled" value="false"/><entry key="RegularEntity" value="true"/><entry key="VanEntity" value="false"/><entry key="Application" value="true"/><entry key="Drilldown" value="true"/></option></selection><selection label="Google"summaryDetail="Entities"><item label="Google"type="Parent"value="16821"></item></selection><selection label="Facebook"summaryDetail="Entities"><item label="Facebook"type="Parent"value="1240714"></item></selection></prompt><prompt uiKey="DRM_Target" label="Target"name="Target"><selection label="Target Selection"summaryDetail="Target"></selection></prompt><prompt uiKey="DRM_METRICS" label="Statistics"name="Statistics"><selection label="Unique Audience (000)"summaryDetail="Statistics"><item label="Unique Audience (000)"type="Statistics"value="5123"></item></selection><selection label="Active Reach (%)"summaryDetail="Statistics"><item label="Active Reach (%)"type="Statistics"value="5109"></item></selection><selection label="Universe Reach (%)"summaryDetail="Statistics"><item label="Universe Reach (%)"type="Statistics"value="5112"></item></selection><selection label="Page Views (000)"summaryDetail="Statistics"><item label="Page Views (000)"type="Statistics"value="5139"></item></selection><selection label="Page Views Per Person"summaryDetail="Statistics"><item label="Page Views Per Person"type="Statistics"value="5118"></item></selection><selection label="Page Views Share (%)"summaryDetail="Statistics"><item label="Page Views Share (%)"type="Statistics"value="5140"></item></selection><selection label="Seconds Per Page View"summaryDetail="Statistics"><item label="Seconds Per Page View"type="Statistics"value="5141"></item></selection><selection label="Minutes Per Session"summaryDetail="Statistics"><item label="Minutes Per Session"type="Statistics"value="5119"></item></selection><selection label="Sessions Per Person"summaryDetail="Statistics"><item label="Sessions Per Person"type="Statistics"value="5121"></item></selection><selection label="Total Sessions (000)"summaryDetail="Statistics"><item label="Total Sessions (000)"type="Statistics"value="5114"></item></selection><selection label="Time Per Person (hh:mm:ss)"summaryDetail="Statistics"><item label="Time Per Person (hh:mm:ss)"type="Statistics"value="5110"></item></selection><selection label="Time Spent Share (%)"summaryDetail="Statistics"><item label="Time Spent Share (%)"type="Statistics"value="5138"></item></selection><selection label="Total Minutes (000)"summaryDetail="Statistics"><item label="Total Minutes (000)"type="Statistics"value="5117"></item></selection></prompt><outputDefinition><queryDef><query type="CREATE"key="output0"><sqlId>createStandardReport</sqlId><nsMapper>com.nielsen.media.mediaView.drm.StandardMapper</nsMapper></query><query type="COUNT"key=""><sqlId>countStandardReport</sqlId><nsMapper>com.nielsen.media.mediaView.drm.StandardMapper</nsMapper></query><query type="RETRIEVE"key=""><sqlId>retrieveStandardReport</sqlId><nsMapper>com.nielsen.media.mediaView.drm.StandardMapper</nsMapper></query></queryDef><layoutDef factory="com.nielsen.media.mediaView.drm.layout.factory.DRMLayoutFactoryImpl"><layout default="false"><displayName tag="drm.layouts.stdMetrics.displayName">Standard Metrics</displayName><componentName>StandardMetrics</componentName><componentVersion>1.0</componentVersion><properties><property key="associatedPrompts">Sample,Entities,DRM_Target,DRM_METRICS</property></properties></layout></layoutDef><exportDef><export outputType="EXCEL_2007" factory="com.nielsen.media.mediaView.drm.export.factory.DRMExportTaskFactory" uiCompatible="true" autoGenerate="true" default="false"><property key="exportRequest.outputFilename"><![CDATA[{reportName}]]></property><property key="contextLocation"><![CDATA[/WEB-INF/export/DRMExportTaskContext.xml]]></property></export><export outputType="CSV" factory="com.nielsen.media.mediaView.drm.export.factory.DRMExportTaskFactory" uiCompatible="true" autoGenerate="true" default="false"><property key="exportRequest.outputFilename"><![CDATA[{reportName}]]></property><property key="contextLocation"><![CDATA[/WEB-INF/export/DRMExportTaskContext.xml]]></property></export></exportDef></outputDefinition></spec>

,

Thanks & Regards

Mahesh

 

0 Likes
1 Reply
Highlighted
Frequent Contributor.
Frequent Contributor.

Hello,

The  lr_xml_transform allows you to apply an Extensible Stylesheet Language (XSL) Transformation to XML data

Following is just a example, you can write own stylesheet and transfer the xml to what you want. 

char* stylesheet = 
"<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">"
 "<xsl:output omit-xml-declaration=\"yes\" indent=\"yes\"/>"
    "<xsl:template match=\"node()|@*\">"
      "<xsl:copy>"
          "<xsl:apply-templates select=\"node()|@*\"/>"
      "</xsl:copy>"
    "</xsl:template>"
"</xsl:stylesheet>";
    
    char* xml_input = "<root a=\"1\" b=\"2\"><sub1/><sub2><sub3 c=\"3\">asdf</sub3></sub2></root>";
    
    lr_save_string(xml_input, "XML_Input_Param"); // Save to a parameter
    lr_save_string(stylesheet, "XML_StyleSheet_Param");// Save to a parameter 
    lr_xml_transform("XML={XML_Input_Param}",
                     "ResultParam=Result",
                     "Stylesheet={XML_StyleSheet_Param}",
                     LAST );
    lr_output_message(lr_eval_string("String after transformation:\n{Result}"));

 

Regards,

Bingle(LoadRunner R&D)

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.