Not had much experience of javascript, or nightwatch.js so apologies if this seems an obvious thing to do.
I have a dropdown menu that gets randomly populated.
What I'd like to do is randomly select one of these dropdown menu options.
The html for the drop-down menu is as follows;
And I'd like to select just one entry from the list (which of course would change - including the number of entries and names - the next time the element is loaded).
I have a working ruby script;
modelrangeselect = @driver.find_element(:id, 'listRange_ddlItems')
carmodelrange = modelrangeselect.find_elements(:tag_name =>
'option').sample
But I just can't work out what the javascript equivalent would be so I can run it on nightwatch.js.
Any help would be really appreciated.
Thanks.