Reputation: 115
Really quick (but complicated?) question.
I have this:
<select multiple="multiple" id="id_products" class="selectmultiple" name="products">
<option value="3243">testproductP (3243)</option>
<option value="3244">testproductQ (3244)</option>
</select>
I need to robotframework with selenium to replicate that I select an option. However I can not find a keyword like "Select Option". So I tried using "Click Element" with an xpath pointing to the option.
Click Element xpath=//select[@name="products"]/option[@value=3244]
However this fails the test with the error: "timeout: timed out"
The xpath returns the correct element, but somehow it times out. Maybe Click Element is not supposed to be used like this, but I can't find a better keyword.
Any idea what's going on?
Upvotes: 3
Views: 29937
Reputation: 27
Try to select the element using Javascript. Example:
Execute Javascript document.querySelector("your css").click()
Upvotes: -2
Reputation: 1
Use " select element by value " keyword and specify the Xpath of the list dropdown and value of component which you want to select from list.
Upvotes: 0
Reputation: 1143
Click Element waits for a page load event unless you give it an additional parameter telling it not to wait. However, you should also be able to use the "Select From List" keyword.
Have fun!
Upvotes: 6