Bruj
asked on
Looking for way to select a dropdown option with selenium wrapper in VBA
I have the following html that I want to select "Orders"
When I run the firebug from Firefox, it gives me the following when I record the macro
' ERROR: Caught exception [TypeError: value.replace is not a function]
How would I select option "Orders" value 9 using selenium wrapper?
<select id="saved_queries" onchange="change_qb_export_filetype();ProcessFieldUsage(this)" name="QB_ID">
<option value="8" data-filetype=""></option>
<option value="3" data-filetype="CSV">AllCategories</option>
<option value="4" data-filetype="CSV">AllCustExport</option>
<option value="7" data-filetype="CSV">MasterProductExport</option>
<option value="10" data-filetype="CSV">OrderDetails</option>
<option value="9" data-filetype="CSV">Orders</option>
<option value="6" data-filetype="CSV">ProductEx1</option>
</select>
When I run the firebug from Firefox, it gives me the following when I record the macro
' ERROR: Caught exception [TypeError: value.replace is not a function]
How would I select option "Orders" value 9 using selenium wrapper?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried to use the macro recorder for VBA remote, and it gave me a workable code!
Here is what is working:
driver.Select "id=saved_queries", "label=Orders"
I hope this helps somebody else!
Cheers and Thanks
Here is what is working:
driver.Select "id=saved_queries", "label=Orders"
I hope this helps somebody else!
Cheers and Thanks
ASKER
I have used "selector", I have tried the ID and the name.
Open in new window
Thanks!