jasontj Posted January 26, 2024 Posted January 26, 2024 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
Danp2 Posted January 26, 2024 Posted January 26, 2024 Did you try to perform this with either _WD_ElementOptionSelect or _WD_ElementSelectAction? Latest Webdriver UDF Release Webdriver Wiki FAQs
jasontj Posted January 26, 2024 Author Posted January 26, 2024 ; 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.
Solution jasontj Posted January 26, 2024 Author Solution Posted January 26, 2024 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
mikos65 Posted February 3, 2024 Posted February 3, 2024 (edited) Please help me ... How i can select this on page: Edited February 5, 2024 by mikos65
Danp2 Posted February 3, 2024 Posted February 3, 2024 @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
mikos65 Posted February 3, 2024 Posted February 3, 2024 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 :(
Developers Jos Posted February 3, 2024 Developers Posted February 3, 2024 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.
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