Trying to retrieve the componentId as a variable from the response below using the CSS/JQuery Extractor in JMeter.
I'm successfully getting the componentId returned using
Expression: div#tab2-WidgetList span[componentType="portlet.application.widgets.monitorproxy"]
Attribute: componentId
I could specify Match No. = 1 to return the first and Match No. = 2 to return the second, but I want to avoid hard coding it in case the order changes in the future.
I would like to return the value based off of the span elements of Test1 and Test2.
<li class="tab">
<table id="tab2" class="tabTable tabTableSelected" cellpadding="0" onmousedown="tab.Console.openView('tab2', 'NONE', 'NONE', true, false, '');">
<tr>
<td class="tabLeft"> </td>
<td class="tabCenter">
<span class="tabIconSpan"><img class="primaryTabIcon" src="/test/css/icons_24/Window View Large Icons.png"></span>
<span id="tab2Label" class="tabLabel">Dashboard</span>
</td>
<td class="tabRight"> </td>
</tr>
</table>
<div id="tab2-WidgetList" class="tabMenu">
<span componentId="1234" componentType="portlet.application.widgets.monitorproxy" iconSource="/tabTest/css/icons_16/User1.png">Test1</span>
<span componentId="9876" componentType="portlet.application.widgets.monitorproxy" iconSource="/tabTest/css/icons_16/User2.png">Test2</span>
</div>
</li>
JMeter is still pretty new to me, so I've been having some trouble getting this one down.
div#tab2-WidgetList span[iconSource ="/tabTest/css/icons_16/User2.png"]
?