0

I have two select options.Based on first option selected we can chose the second option. Based on the Industry we choose we have to select the category. My code is

<select name="data[Product][industry_id]" class="form-control" id="ProductIndustryId">
<option value="">-Select Industry-</option>
<option value="1">Textiles</option>
<option value="2">Automobiles</option>
<option value="10">Home Improvement</option>
</select>

<select name="data[Product][category_id]" class="form-control" id="ProductCategoryId">
</select>

On Selection of my industry will automatically populate the category.But was not able to select the industry using regex

Xpath extractor

 Reference name: indus
 Xpath Query:         
                //select[@id='ProductIndustryId']/option[text()='Automobiles']/@value 
 Default Value: NONE

Any help...

1 Answers1

0

I'd rather go for XPath Extractor as it isn't recommended to parse HTML with regular expressions.

For instance if you want to get value for Automobiles which is 2 you need following expression:

//select[@id='ProductIndustryId']/option[text()='Automobiles']/@value

I guess that the category is being auto-populated using JavaScript. JMeter isn't capable of executing JavaScript so you'll need to do the mapping manually.

Community
  • 1
  • 1
Dmitri T
  • 159,985
  • 5
  • 83
  • 133