Home > Mobile >  Regex to extract option names into specific select
Regex to extract option names into specific select

Time:01-20

In Jmeter, I need to extract values from a dropdown list in a response. For simplifying, I have this response :

<html>
<body>
    <div>
        <select id="toto" style="width:100px;">
            <option selected name="name1" value="value 1"></option>
            <option selected name="name2" value="value 2"></option>
            <option selected name="name3" value="value 3"></option>
        </select>
    </div>
    <div>
        <select id="tutu" style="width:100px;">
            <option selected name="name1" value="value 1"></option>
            <option selected name="name2" value="value 2"></option>
            <option selected name="name3" value="value 3"></option>
        </select>
    </div>
</body>
</html>

And I need to extract name1, name2 and name3 from the second select (id="tutu"). I can't use XPath because my HTML file is not a valid XML.

CodePudding user response:

Try using enter image description here

More information:

  • enter image description here

  • Related