Re: I need to correlate a value, but the only LB and RB I can use appear thousands of times (804 Views)
Reply
Occasional Collector
wrecker14
Posts: 1
Registered: ‎01-02-2014
Message 1 of 3 (842 Views)

I need to correlate a value, but the only LB and RB I can use appear thousands of times

I'm looking to make a correlation for a dropdown menu. I need the number inside this option value:

 

<option value="2386">

 

My LB would be <option value=" and RB ">

 

The problem is this returns thousands of values. I can't use ORD since there is always a different number of option values based on earlier actions inside my script. I also don't think REGEXP will help here since there are other option values that contain 4 digits.

 

The reason I can't make my LB more specific is because I need to select a random option value for that drop down menu. This is the full block below:

 

<td colspan="6">
                    <select name="DrpDwnProblemDetail" onchange="javascript&colon;setTimeout(&#39;__doPostBack(\&#39;DrpDwnProblemDetail\&#39;,\&#39;\&#39;)&#39;, 0)" id="DrpDwnProblemDetail" style="width:584px;">
	<option selected="selected" value="0">[SELECT]</option>
	<option value="2386">###########</option>
	<option value="2387">##########</option>
	<option value="2390">###########</option>
	<option value="2388">###########</option>
	<option value="2389">#############</option>

</select></td>

 So I need to scan through and find that drop down menu, the count of option values under it, and then select a random one. This wouldn't be a problem if there weren't hundreds of other identical drop down option values that use the same boundaries, causing me to have a much higher count value than is actually there.

 

I'm not sure if this would be a viable solution, but I set a correlation to take that entire block of text:

 

web_reg_save_param("c_TESTING", "LB=<select name=\"DrpDwnProblemDetail\"", "RB=</select>", LAST);

 Is there some way that I can now perform a correlation on that parameter I just created? This would only return any option values for the correct menu.

 

Any advice would be appreciated, please let me know if I didn't explain this clearly or if more information is needed.

 

*I'm running VuGen 11.52 on Windows 7

Frequent Advisor
xtom
Posts: 55
Registered: ‎06-06-2012
Message 2 of 3 (814 Views)

Re: I need to correlate a value, but the only LB and RB I can use appear thousands of times

Hello!

 

May be you can use a parameter file that contains at least 2 colums. One for the selection that is necessary to follow the "earlier action" paired with the values of the drop down list that contains the selections depending on this "earlier action". Then you can select randomly to execute the "earlier action" and use the same line for the drop down value.

 

Regards

Thomas

Valued Contributor
Ajay_U
Posts: 108
Registered: ‎04-30-2012
Message 3 of 3 (804 Views)

Re: I need to correlate a value, but the only LB and RB I can use appear thousands of times

Capture the total string with all the corresponding dropdown values and delimit from that string.

 

Like in your case use "

select name="DrpDwnProblemDetail" as the LB and
</select></td> as the RB that will capture all the availabe drop down values. use strtok() function and delimit and select a random one.

Thanks, Ajay
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.