jasontj Posted January 26 Share Posted January 26 Hi. I am trying to select the value from a drop down "select" list from this site: https://www.dallascounty.org/criminalBackgroundSearch/search.jsp I want to change the DOB Month and DOB Day based on the "values". So, 01, 02, etc from these lists. <select name="dobMonth" size="1" class="form-select form-select-lg"> <option value=""> </option> <option value="01">January</option> <option value="02">February</option> <option value="03">March</option> <option value="04">April</option> <option value="05">May</option> <option value="06">June</option> <option value="07">July</option> <option value="08">August</option> <option value="09">September</option> <option value="10">October</option> <option value="11">November</option> <option value="12">December</option> </select> Below is the only code that I have found that works. Sure seems overly complicated. I'd love to have a more efficient solution for this. _WD_ExecuteScript($sSession, "var element = document.evaluate('/html/body/div/form[1]/div[10]/div/div[2]/select', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue; element.value = '" & $sCellValueMonth & "'; element.dispatchEvent(new Event('change'));") Thanks in advance for any help on this. Jason Link to comment Share on other sites More sharing options...
Danp2 Posted January 26 Share Posted January 26 Did you try to perform this with either _WD_ElementOptionSelect or _WD_ElementSelectAction? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
jasontj Posted January 26 Author Share Posted January 26 ; line below works. just need to subtract 1 from the month value. Should work the same for Day. _WD_ElementOptionSelect($sSession, $_WD_LOCATOR_ByXPath, "//select[@name='dobMonth']//option[03]") I did, but this will only for when the values in the list are numbered, like day of Month. I've got another page where the states need to be selected, "TX", "UT", etc. So I need this to work based on a value, not on a position. I must be missing something simple on this. Link to comment Share on other sites More sharing options...
Solution jasontj Posted January 26 Author Solution Share Posted January 26 Got it. Thanks for the push in the right direction @Danp2 $sCellValueMonth = "05" ; this will set it to "May" _WD_ElementOptionSelect($sSession, $_WD_LOCATOR_ByXPath, "//select[@name='dobMonth']/option[@value='" & $sCellValueMonth & "']") Danp2 1 Link to comment Share on other sites More sharing options...
mikos65 Posted February 3 Share Posted February 3 (edited) Please help me ... How i can select this on page: Edited February 5 by mikos65 Link to comment Share on other sites More sharing options...
Danp2 Posted February 3 Share Posted February 3 @mikos65 What have you tried thus far? Note that this isn't a standard Select element, so the above discussion may not apply. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
mikos65 Posted February 3 Share Posted February 3 44 minutes ago, Danp2 said: @mikos65 What have you tried thus far? Note that this isn't a standard Select element, so the above discussion may not apply. I'm trying and I can't do anything :( Link to comment Share on other sites More sharing options...
Developers Jos Posted February 3 Developers Share Posted February 3 10 minutes ago, mikos65 said: I'm trying and I can't do anything that is a silly answer! Show what you are trying is the simple question! SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now