Tell me more ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm trying to test a registration form with Selenium IDE, but am having trouble with select elements from the Chosen library: http://harvesthq.github.io/chosen/

I wonder if you can help me with the commands to select an option (could be any option by the way). I couldn't get past opening the dropdown with a simple mouseDown. Here's a sample webpage with both a single and multi select (download source files from the repository above.

<html>
<head>
    <link rel="stylesheet" href="chosen/public/chosen.min.css">
    <link rel="stylesheet" href="chosen/public/chosen.jquery.min.css">
    <script src="jquery-1.10.2.min.js"></script>
    <script src="chosen/public/chosen.jquery.min.js"></script>
</head>
<body>
    <select multiple class="chzn-select" style="width: 150px;">
        <option value="Test 1">Test 1</option>
        <option value="Test 2">Test 2</option>
        <option value="Test 3">Test 3</option>
    </select>
    <br><br>
    <select class="chzn-select" style="width: 150px;">
        <option value="Test A">Test A</option>
        <option value="Test B">Test B</option>
        <option value="Test C">Test C</option>
    </select>   

    <script type="text/javascript">
        $(".chzn-select").chosen();
    </script>
</body>
</html>
share|improve this question
add comment (requires an account with 50 reputation)

1 Answer

up vote 1 down vote accepted

Ok I did manage to crack it myself and it was as simple as:

Command: clickAt

Target: css=#id_country_chzn_o_1

(chooses the first item on a list of countries, use Firebug to find out what your ids are called)

share|improve this answer
add comment (requires an account with 50 reputation)

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.