
NSearch
Active Members-
Posts
228 -
Joined
-
Last visited
Everything posted by NSearch
-
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
@Danp2 Thank you for the response and the hint on where to look.....I searched for "error":"element click intercepted" and found another post that you offered advice on, and it worked in my case. -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
@Danp2 I just tried clicking the label with the code below and was not successful. $honesty_statement = _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, '//*[@id="claimHonestyStatementAgreement"]',5000,8000) If $honesty_statement then $sElementSelector = '//*[@id="ups-main"]/div/div/ups-cou-app/div/new-claims/ng-component/div[2]/div/form/div[1]/div/label' $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sElementSelector) ConsoleWrite("$sElement = " & $sElement & @CRLF) $sAction = '{"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"' $sAction &= $sElement & '","' & $_WD_ELEMENT_ID & '":"' & $sElement & '"}},{"button":1,"type":"pointerDown"},{"button":1,"type":"pointerUp"}]}]}' ConsoleWrite("$sAction = " & $sAction & @CRLF) _WD_Action($sSession, "actions", $sAction) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '//*[@id="ups-main"]/div/div/ups-cou-app/div/new-claims/ng-component/div[2]/div/form/div[1]/div/label') _WD_ElementAction($sSession, $sElement, 'click') EndIf __WD_Post: URL=HTTP://127.0.0.1:9515/session/79ad015c9cb560ae08a0117922451fd1/element; $sData={"using":"xpath","value":"//*[@id=\"ups-main\"]/div/div/ups-cou-app/div/new-claims/ng-component/div[2]/div/form/div[1]/div/label"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"9039c2a0-3817-4f3e-a17b-3dcf843bb73f"}} _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"9039c2a0-3817-4f3e-a17b-3dcf843bb73f"}} $sElement = 9039c2a0-3817-4f3e-a17b-3dcf843bb73f $sAction = {"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"9039c2a0-3817-4f3e-a17b-3dcf843bb73f","element-6066-11e4-a52e-4f735466cecf":"9039c2a0-3817-4f3e-a17b-3dcf843bb73f"}},{"button":1,"type":"pointerDown"},{"button":1,"type":"pointerUp"}]}]} __WD_Post: URL=HTTP://127.0.0.1:9515/session/79ad015c9cb560ae08a0117922451fd1/actions; $sData={"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"9039c2a0-3817-4f3e-a17b-3dcf843bb73f","element-6066-11e4-a52e-4f735466cecf":"9039c2a0-3817-4f3e-a17b-3dcf843bb73f"}},{"button":1,"type":"pointerDown"},{"button":1,"type":"pointerUp"}]}]} __WD_Post: StatusCode=200; ResponseText={"value":null} _WD_Action: {"value":null} __WD_Post: URL=HTTP://127.0.0.1:9515/session/79ad015c9cb560ae08a0117922451fd1/element; $sData={"using":"xpath","value":"//*[@id=\"ups-main\"]/div/div/ups-cou-app/div/new-claims/ng-component/div[2]/div/form/div[1]/div/label"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"9039c2a0-3817-4f3e-a17b-3dcf843bb73f"}} _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"9039c2a0-3817-4f3e-a17b-3dcf843bb73f"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/79ad015c9cb560ae08a0117922451fd1/element/9039c2a0-3817-4f3e-a17b-3dcf843bb73f/click; $sData={"id":"9039c2a0-3817-4f3e-a17b-3dcf843bb73f"} __WD_Post: StatusCode=200; ResponseText={"value":null} _WD_ElementAction: {"value":null}... <label class="ups-checkbox-custom-label" for="claimHonestyStatementAgreement"> By selecting this box, I certify that the information provided in this submission for Claim Payment and all communications related to this request including but not limited to, statements as to the actual contents and value of items that have been lost or damaged are true and accurate to the best of my knowledge and that this request has been submitted in good faith. * </label> -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Hi @Danp2, I am now working with the UPS website and unfortunately I cannot post a link to the page, because it is accessed after entering a username and password (that I cannot post publicly). There is a checkbox that I cannot click using _WD_ElementAction($sSession, $sElement, 'click') -- trying with xpath and full xpath I suspect that there is some javascript that needs to be triggered prior to clicking, but so far I have been unsuccessful and I was hoping you could help out. Below is a combination of what I found in the wd_demo and some attempts that I have made: $honesty_statement = _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, '//*[@id="claimHonestyStatementAgreement"]',5000,8000) If $honesty_statement then $sElementSelector = "//input[@name='claimHonestyStatementAgreement']" $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sElementSelector) ConsoleWrite("$sElement = " & $sElement & @CRLF) $sAction = '{"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"' $sAction &= $sElement & '","' & $_WD_ELEMENT_ID & '":"' & $sElement & '"}},{"button":2,"type":"pointerDown"},{"button":2,"type":"pointerUp"}]}]}' ConsoleWrite("$sAction = " & $sAction & @CRLF) _WD_Action($sSession, "actions", $sAction) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '/html/body/div[2]/div[2]/div/div/main/div/div/ups-cou-app/div/new-claims/ng-component/div[2]/div/form/div[1]/div/input') _WD_ElementAction($sSession, $sElement, 'click') EndIf __WD_Post: URL=HTTP://127.0.0.1:9515/session/d7224439d0b531ea15bfc58cea089ef4/element; $sData={"using":"xpath","value":"//*[@id=\"claimHonestyStatementAgreement\"]"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6"}} _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6"}} _WD_WaitElement ==> Success __WD_Post: URL=HTTP://127.0.0.1:9515/session/d7224439d0b531ea15bfc58cea089ef4/element; $sData={"using":"xpath","value":"//input[@name='claimHonestyStatementAgreement']"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6"}} _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6"}} $sElement = 2bf44c74-6d66-43da-949a-2e3cad0ab8b6 $sAction = {"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6","element-6066-11e4-a52e-4f735466cecf":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6"}},{"button":1,"type":"pointerDown"},{"button":1,"type":"pointerUp"}]}]} __WD_Post: URL=HTTP://127.0.0.1:9515/session/d7224439d0b531ea15bfc58cea089ef4/actions; $sData={"actions":[{"id":"default mouse","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"duration":100,"x":0,"y":0,"type":"pointerMove","origin":{"ELEMENT":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6","element-6066-11e4-a52e-4f735466cecf":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6"}},{"button":1,"type":"pointerDown"},{"button":1,"type":"pointerUp"}]}]} __WD_Post: StatusCode=200; ResponseText={"value":null} _WD_Action: {"value":null} __WD_Post: URL=HTTP://127.0.0.1:9515/session/d7224439d0b531ea15bfc58cea089ef4/element; $sData={"using":"xpath","value":"/html/body/div[2]/div[2]/div/div/main/div/div/ups-cou-app/div/new-claims/ng-component/div[2]/div/form/div[1]/div/input"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6"}} _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/d7224439d0b531ea15bfc58cea089ef4/element/2bf44c74-6d66-43da-949a-2e3cad0ab8b6/click; $sData={"id":"2bf44c74-6d66-43da-949a-2e3cad0ab8b6"} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Cinput aria-describedby=\"claimHonestyStatementAgreement_error\" aria-required=\"true\" class=\"ups-checkbox-custom ng-untouched ng-pristine ng-invalid\" formcontrolname=\"claimHonestyStatementAgreement\" id=\"claimHonestyStatementAgreement\" name=\"claimHonestyStatementAgreement\" required=\"\" type=\"checkbox\" value=\"1\"> is not clickable at point (66, 219). Other element would receive the click: \u003Clabel class=\"ups-checkbox-custom-label\" for=\"claimHonestyStatementAgreement\">...\u003C/label>\n (Session info: chrome=89.0.4389.82)","stacktrace":"Backtrace:\n\tGetHandleVerifier [0x0033B963+483]\n\tGetHandleVerifier [0x0033B941+449]\n\tGetHandleVerifier [0x006E3308+3832712]\n\tGetHandleVerifier [0x00709FB1+3991601]\n\tGetHandleVerifier [0x00708D51+3986897]\n\tGetHandleVerifier [0x0070780B+3981451]\n\tGetHandleVerifier [0x00706E1C+3978908]\n\tGetHandleVerifier [0x00700199+3951129]\n\tGetHandleVerifier [0x0071B403+4062339]\n\tGetHandleVerifier [0x006FFFB6+3950646]\n\tGetHandleVerifier [0x0071B4CA+4062538]\n\tGetHandleVerifier [0x00727159+4110809]\n\tGetHandleVerifier [0x0071B2EB+4062059]\n\tGetHandleVerifier [0x006FED14+3945876]\n\tGetHandleVerifier [0x006FFBCE+3949646]\n\tGetHandleVerifier [0x006FFB59+3949529]\n\tOrdinal0 [0x002FB5CC+46540]\n\tOrdinal0 [0x002F9F53+40787]\n\tOrdinal0 [0x002F9B12+39698]\n\tGetHandleVerifier [0x00601468+2907368]\n\tGetHandleVerifier [0x004471EE+1096302]\n\tGetHandleVerifier [0x00403E8D+821005]\n\tGetHandleVerifier [0x0040396B+819691]\n\tGetHandleVerifier [0x00403881+819457]\n\tGetHandleVerifier [0x0042F463+998627]\n\tBaseThreadInitThunk [0x7551FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x76EC7C7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x76EC7C4E+238]\n"}} _WD_ElementAction: {"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Cin... _WD_ElementAction ==> Webdriver Exception: {"value":{"error":"element click intercepted","message":"element click intercepted: Element \u003Cinput aria-describedby=\"claimHonestyStatementAgreement_error\" aria-required=\"true\" class=\"ups-checkbox-custom ng-untouched ng-pristine ng-invalid\" formcontrolname=\"claimHonestyStatementAgreement\" id=\"claimHonestyStatementAgreement\" name=\"claimHonestyStatementAgreement\" required=\"\" type=\"checkbox\" value=\"1\"> is not clickable at point (66, 219). Other element would receive the click: \u003Clabel class=\"ups-checkbox-custom-label\" for=\"claimHonestyStatementAgreement\">...\u003C/label>\n (Session info: chrome=89.0.4389.82)","stacktrace":"Backtrace:\n\tGetHandleVerifier [0x0033B963+483]\n\tGetHandleVerifier [0x0033B941+449]\n\tGetHandleVerifier [0x006E3308+3832712]\n\tGetHandleVerifier [0x00709FB1+3991601]\n\tGetHandleVerifier [0x00708D51+3986897]\n\tGetHandleVerifier [0x0070780B+3981451]\n\tGetHandleVerifier [0x00706E1C+3978908]\n\tGetHandleVerifier [0x00700199+3951129]\n\tGetHandleVerifier [0x0071B403+4062339]\n\tGetHandleVerifier [0x006FFFB6+3950646]\n\tGetHandleVerifier [0x0071B4CA+4062538]\n\tGetHandleVerifier [0x00727159+4110809]\n\tGetHandleVerifier [0x0071B2EB+4062059]\n\tGetHandleVerifier [0x006FED14+3945876]\n\tGetHandleVerifier [0x006FFBCE+3949646]\n\tGetHandleVerifier [0x006FFB59+3949529]\n\tOrdinal0 [0x002FB5CC+46540]\n\tOrdinal0 [0x002F9F53+40787]\n\tOrdinal0 [0x002F9B12+39698]\n\tGetHandleVerifier [0x00601468+2907368]\n\tGetHandleVerifier [0x004471EE+1096302]\n\tGetHandleVerifier [0x00403E8D+821005]\n\tGetHandleVerifier [0x0040396B+819691]\n\tGetHandleVerifier [0x00403881+819457]\n\tGetHandleVerifier [0x0042F463+998627]\n\tBaseThreadInitThunk [0x7551FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x76EC7C7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x76EC7C4E+238]\n"}} <input aria-describedby="claimHonestyStatementAgreement_error" aria-required="true" class="ups-checkbox-custom ng-untouched ng-pristine ng-invalid" formcontrolname="claimHonestyStatementAgreement" id="claimHonestyStatementAgreement" name="claimHonestyStatementAgreement" required="" type="checkbox" value="1"> -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
@Nine Thank you very much -- I made a few changes and it works! Local $sTargetDate = "2020/09/02" Local $sToday = _NowCalcDate() Local $iDateDiff = _DateDiff("M", StringTrimRight($sTargetDate, 2) & StringRight($sToday, 2), $sToday) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath,'//*[@id="shipDateInput"]') _WD_ElementAction($sSession, $sElement, 'click') For $i = 1 to $iDateDiff $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '//a[@id="calprev"]') _WD_ElementAction($sSession, $sElement, 'click') Sleep(800) Next $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, '//a[@href="#' & Int(StringRight($sTargetDate,2)) & '"]') _WD_ElementAction($sSession, $sElement, 'click') I mentioned this before in a previous post, but for those that really make a difference and go out of their way to help, like @Nine and @Danp2, please setup a https://www.buymeacoffee.com/ and put it in your signature block. Very much appreciated -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
@Nine Thank you very much for the reply.....I didn't know how to send ArrowLeft to the calendar, but I tried something similar. Thank you for showing me this. I just tried a modified version of your code, by trying again to just use ArrowLeft, but I realized that it will not work because when you go back a month it will display the previous month days again. Very frustrating....and you probably tried this yourself, which is why you are using multiple action statements. I am wondering if it is possible to read the calendar values in a loop so that you arrowleft until shipate equals the read calendar value? -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
@Danp2 This is a tough one -- no luck with the code above or with _WD_ExecuteScript($sSession, "$('#shipDateInput').data('dateinput').setDate(21, 01, 28);") -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
@Danp2 same problem with me -- I thought logging in may change the result, but I am not able to send the date to the input box. I will continue to try different variations of the date, but if you have any other ideas, please let me know. Thank you very much for your help! -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
Thanks @Danp2 - I have been trying to make sense of the page....no luck yet. _WD_ExecuteScript($sSession, "$('#shipDateInput').dateinput('setDate', '09/20/20');") Am I on the right path? -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
Thanks for the response @Danp2 Please see the snippet below #include "wd_core.au3" #include "wd_helper.au3" _WD_Option('Driver', @ScriptDir & '\chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit -1 EndIf $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--disable-blink-features=AutomationControlled"]}}}}' $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.fedex.com/apps/onlineclaims/?locale=en_US") Sleep(1500) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath,'//*[@id="trackingNumber"]') _WD_ElementAction($sSession, $sElement, 'value', '922897835504') Sleep(3000) _WD_ElementOptionSelect($sSession, $_WD_LOCATOR_ByXPath, "//div/select/option[@value='LC']") sleep(3000) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@id='tracking_nbr_cont_btn']") _WD_ElementAction($sSession, $sElement, 'click') MsgBox(0,"Stop","") -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
@Danp2 I think this is a unique problem that has not been addressed before. I am trying to send a date to an input, but it is not populating the input box....so I tried to manually type the date and couldn't. When the input box is clicked at calendar pops up, which is how you're supposed to enter the date. I was able to copy and ctrl+v paste the date to the input, but that doesn't seem like a streamline solution. I even tried finding the date difference between now() and the ship date and sending left to the calendar x number of times. $ship_date_popup_exists = _WD_WaitElement($sSession, $_WD_LOCATOR_ByXPath, '//*[@id="ship_date_prompt_done"]',3000,4000) If $ship_date_popup_exists = 1 Then $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath,'//*[@id="shipDateInput"]') _WD_ElementAction($sSession, $sElement, 'click') _WD_ElementAction($sSession, $sElement, 'value', $oShip_Date_Popup_Format) ; MM/dd/yy ;~ $oShip_Date_Diff = _DateDiff('D', StringSplit($oShip_Date,"/")[3] & "/" & $oShip_Date_Month & "/" & $oShip_Date_Day & " 00:00:00", _NowCalc()) ;~ Send("{LEFT}",$oShip_Date_Diff) EndIf <div id="modal" class="reveal-modal" style="max-width: 860px; top: 70px; opacity: 1; visibility: visible; display: block;"><div id="modal-content"><div id="leaveTab" data-load-tab=""> <fieldset style="width:100%;"> <div class="datapoint fx_clearfix" id="city_div" style="width:40%;"> <label for="">Ship Date</label> <input type="text" name="shipdate" class="required date" id="shipDateInput"> </div> <div class="datapoint fx_clearfix" id="city_div" style="width:40%;"> <label for="">Carrier Type</label> <select name="opco" class="required" id="opcoInput"> <option value="">Select</option> <option value="Ground">Ground</option> <option value="Express">Express</option> </select> </div> <div class="buttons cf" style="margin: 10px 0;"> <div class="purple"><button class="btn-primary leave-the-tab" id="ship_date_prompt_done">Done</button></div> </div> </fieldset> </div> <a class="close-reveal-modal" id="modal_close"></a> </div></div> Calendar section <div id="calroot" style="position: absolute; top: 151px; left: 62px;"><div id="calhead"><a id="calprev"></a><div id="caltitle">March 2021</div><a id="calnext" class="caldisabled"></a></div><div id="calbody"><div id="caldays"><span>Sun</span><span>Mon</span><span>Tue</span><span>Wed</span><span>Thu</span><span>Fri</span><span>Sat</span></div><div id="calweeks"><div class="calweek"><a class="caloff" href="#28">28</a><a href="#1">1</a><a href="#2">2</a><a href="#3">3</a><a href="#4">4</a><a href="#5">5</a><a href="#6">6</a></div><div class="calweek"><a href="#7">7</a><a href="#8">8</a><a href="#9">9</a><a id="calcurrent" class="calfocus" href="#10">10</a><a class="caldisabled" href="#11">11</a><a class="caldisabled" href="#12">12</a><a class="caldisabled" href="#13">13</a></div><div class="calweek"><a class="caldisabled" href="#14">14</a><a class="caldisabled" href="#15">15</a><a class="caldisabled" href="#16">16</a><a class="caldisabled" href="#17">17</a><a class="caldisabled" href="#18">18</a><a class="caldisabled" href="#19">19</a><a class="caldisabled" href="#20">20</a></div><div class="calweek"><a class="caldisabled" href="#21">21</a><a class="caldisabled" href="#22">22</a><a class="caldisabled" href="#23">23</a><a class="caldisabled" href="#24">24</a><a class="caldisabled" href="#25">25</a><a class="caldisabled" href="#26">26</a><a class="caldisabled" href="#27">27</a></div><div class="calweek"><a class="caldisabled" href="#28">28</a><a class="caldisabled" href="#29">29</a><a class="caldisabled" href="#30">30</a><a class="caldisabled" href="#31">31</a><a class="caloff caldisabled" href="#1">1</a><a class="caloff caldisabled" href="#2">2</a><a class="caloff caldisabled" href="#3">3</a></div><div class="calweek"><a class="caloff caldisabled" href="#4">4</a><a class="caloff caldisabled" href="#5">5</a><a class="caloff caldisabled" href="#6">6</a><a class="caloff caldisabled" href="#7">7</a><a class="caloff caldisabled" href="#8">8</a><a class="caloff caldisabled" href="#9">9</a><a class="caloff caldisabled" href="#10">10</a></div></div></div></div> Thanks in advance for your help -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
@Danp2 Excellent! Thank you so much! If you don't have a https://www.buymeacoffee.com/ account set up, please get one so I can buy you a drink! -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
@Danp2, Yes, you're right, I accidently left that line of code in.....I was thinking of editing, but maybe someone else will find this mistake useful. For the second point, I attempted manually after wd_navigate and got the same result. Do you have any recommendations on what I could do now? -
WebDriver UDF - Help & Support (II)
NSearch replied to Danp2's topic in AutoIt General Help and Support
Hi @Danp2 and everyone on this thread -- it's been awhile since I have been to the forum, but spent a few days catching up where I could. Thanks in advance for any help you can provide. I cannot get a form to submit with the following code: _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit -1 EndIf $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.fedex.com/apps/onlineclaims/?locale=en_US") _WD_LoadWait($sSession, 3000) $Tracking_Number = '962515408056' $Lost_Damaged = "Shipment not received" $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sElementSelector) $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div/input", Default, True) _WD_ElementAction($sSession, $aElements[1], 'value', $Tracking_Number) $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div/select", Default, True) _WD_ElementAction($sSession, $aElements[0], 'value', $Lost_Damaged) $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div/button", Default, True) _WD_ElementAction($sSession, $aElements[1], 'click') MsgBox(0,"stop here","") _WD_DeleteSession($sSession) _WD_Shutdown() The console readout is: _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WDStartup: OS: WIN_10 WIN32_NT 19041 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.4.0.1 (Up to date) _WDStartup: WinHTTP: 1.6.4.2 _WDStartup: Driver: C:\FCI\Resources\ChromeDriver\chromedriver.exe _WDStartup: Params: --verbose --log-path="C:\FCI\Claims\FedEx_Claim_Forms\Scripts\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false }}}} __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"88.0.... _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"88.0.4324.182","chrome":{"chromedriverVersion":"88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324@{#1784})","userDataDir":"C:\\Users\\SA\\AppData\\Local\\Temp\\scoped_dir2772_1264260059"},"goog:chromeOptions":{"debuggerAddress":"localhost:59442"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:largeBlob":true,"webauthn:virtualAuthenticators":true},"sessionId":"1a5df9600f563207dc754e0b626f22f4"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/1a5df9600f563207dc754e0b626f22f4/url; $sData={"url":"https://www.fedex.com/apps/onlineclaims/?locale=en_US"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_Navigate: {"value":null} __WD_Post: URL=HTTP://127.0.0.1:9515/session/1a5df9600f563207dc754e0b626f22f4/execute/sync; $sData={"script":"return document.readyState", "args":[]} __WD_Post: StatusCode=200; ResponseText={"value":"complete"}... _WD_ExecuteScript: {"value":"complete"}... __WD_Post: URL=HTTP://127.0.0.1:9515/session/1a5df9600f563207dc754e0b626f22f4/element; $sData={"using":"xpath","value":"//input[@name='q']"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\... __WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//input[@name='q']\"}\n (Session info: chrome=88.0.4324.182)","stacktrace":"Backtrace:\n\tGetHandleVerifier [0x00E0B963+483]\n\tGetHandleVerifier [0x00E0B941+449]\n\tGetHandleVerifier [0x011B3308+3832712]\n\tGetHandleVerifier [0x011D61C4+3975748]\n\tGetHandleVerifier [0x011F8822+4116642]\n\tGetHandleVerifier [0x011EB43A+4062394]\n\tGetHandleVerifier [0x011F7159+4110809]\n\tGetHandleVerifier [0x011EB2EB+4062059]\n\tGetHandleVerifier [0x011CED14+3945876]\n\tGetHandleVerifier [0x011CFBCE+3949646]\n\tGetHandleVerifier [0x011CFB59+3949529]\n\tOrdinal0 [0x00DCB5CC+46540]\n\tOrdinal0 [0x00DC9F53+40787]\n\tOrdinal0 [0x00DC9B12+39698]\n\tGetHandleVerifier [0x010D1468+2907368]\n\tGetHandleVerifier [0x00F171EE+1096302]\n\tGetHandleVerifier [0x00ED3E8D+821005]\n\tGetHandleVerifier [0x00ED396B+819691]\n\tGetHandleVerifier [0x00ED3881+819457]\n\tGetHandleVerifier [0x00EFF463+998627]\n\tBaseThreadInitThunk [0x75E7FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x778976B4+228]\n\tRtlGetAppContainerNamedObjectPath [0x77897684+180]\n"}} _WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//input[@name='q']\"}\n (Session info: chrome=88.0.4324.182)","stacktrace":"Backtrace:\n\tGetHandleVerifier [0x00E0B963+483]\n\tGetHandleVerifier [0x00E0B941+449]\n\tGetHandleVerifier [0x011B3308+3832712]\n\tGetHandleVerifier [0x011D61C4+3975748]\n\tGetHandleVerifier [0x011F8822+4116642]\n\tGetHandleVerifier [0x011EB43A+4062394]\n\tGetHandleVerifier [0x011F7159+4110809]\n\tGetHandleVerifier [0x011EB2EB+4062059]\n\tGetHandleVerifier [0x011CED14+3945876]\n\tGetHandleVerifier [0x011CFBCE+3949646]\n\tGetHandleVerifier [0x011CFB59+3949529]\n\tOrdinal0 [0x00DCB5CC+46540]\n\tOrdinal0 [0x00DC9F53+40787]\n\tOrdinal0 [0x00DC9B12+39698]\n\tGetHandleVerifier [0x010D1468+2907368]\n\tGetHandleVerifier [0x00F171EE+1096302]\n\tGetHandleVerifier [0x00ED3E8D+821005]\n\tGetHandleVerifier [0x00ED396B+819691]\n\tGetHandleVerifier [0x00ED3881+819457]\n\tGetHandleVerifier [0x00EFF463+998627]\n\tBaseThreadInitThunk [0x75E7FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x778976B4+228]\n\tRtlGetAppContainerNamedObjectPath [0x77897684+180]\n"}} _WD_FindElement ==> No match: HTTP status = 404 __WD_Post: URL=HTTP://127.0.0.1:9515/session/1a5df9600f563207dc754e0b626f22f4/elements; $sData={"using":"xpath","value":"//div/input"} __WD_Post: StatusCode=200; ResponseText={"value":[{"element-6066-11e4-a52e-4f735466cecf":"77c9900e-c8d3-45ea-9cdf-cf1726b6e777"},{"element-6... _WD_FindElement: {"value":[{"element-6066-11e4-a52e-4f735466cecf":"77c9900e-c8d3-45ea-9cdf-cf1726b6e777"},{"element-6066-11e4-a52e-4f735466cecf":"a4b87814-fb24-478c-968c-a7c52de5d106"}]} __WD_Post: URL=HTTP://127.0.0.1:9515/session/1a5df9600f563207dc754e0b626f22f4/element/a4b87814-fb24-478c-968c-a7c52de5d106/value; $sData={"id":"a4b87814-fb24-478c-968c-a7c52de5d106", "text":"962515408056"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_ElementAction: {"value":null}... __WD_Post: URL=HTTP://127.0.0.1:9515/session/1a5df9600f563207dc754e0b626f22f4/elements; $sData={"using":"xpath","value":"//div/select"} __WD_Post: StatusCode=200; ResponseText={"value":[{"element-6066-11e4-a52e-4f735466cecf":"210eadec-f359-4bb2-8a5c-8a8397dd3141"}]}... _WD_FindElement: {"value":[{"element-6066-11e4-a52e-4f735466cecf":"210eadec-f359-4bb2-8a5c-8a8397dd3141"}]} __WD_Post: URL=HTTP://127.0.0.1:9515/session/1a5df9600f563207dc754e0b626f22f4/element/210eadec-f359-4bb2-8a5c-8a8397dd3141/value; $sData={"id":"210eadec-f359-4bb2-8a5c-8a8397dd3141", "text":"Shipment not received"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_ElementAction: {"value":null}... __WD_Post: URL=HTTP://127.0.0.1:9515/session/1a5df9600f563207dc754e0b626f22f4/elements; $sData={"using":"xpath","value":"//div/button"} __WD_Post: StatusCode=200; ResponseText={"value":[{"element-6066-11e4-a52e-4f735466cecf":"00683a4b-44f5-4562-9864-89dd46852cba"},{"element-6... _WD_FindElement: {"value":[{"element-6066-11e4-a52e-4f735466cecf":"00683a4b-44f5-4562-9864-89dd46852cba"},{"element-6066-11e4-a52e-4f735466cecf":"5d259e27-07f2-4050-ab3a-d70aefce370f"},{"element-6066-11e4-a52e-4f735466cecf":"7b735cde-df58-46d7-a5b5-883348cbc25c"},{"element-6066-11e4-a52e-4f735466cecf":"414c94b7-3d30-46dc-add2-52ebf7a36b75"}]} __WD_Post: URL=HTTP://127.0.0.1:9515/session/1a5df9600f563207dc754e0b626f22f4/element/5d259e27-07f2-4050-ab3a-d70aefce370f/click; $sData={"id":"5d259e27-07f2-4050-ab3a-d70aefce370f"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_ElementAction: {"value":null}... Chromedriver readout: Starting ChromeDriver 88.0.4324.96 (68dba2d8a0b149a1d3afac56fa74648032bcf46b-refs/branch-heads/4324@{#1784}) on port 9515 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. DevTools listening on ws://127.0.0.1:59442/devtools/browser/43d415b1-80af-474a-972e-7ab5aec857b6 [1404:5792:0224/132921.875:ERROR:device_event_log_impl.cc(211)] [13:29:21.874] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F) [1404:5792:0224/132921.876:ERROR:device_event_log_impl.cc(211)] [13:29:21.875] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F) [1404:5792:0224/132921.878:ERROR:device_event_log_impl.cc(211)] [13:29:21.878] USB: usb_device_handle_win.cc:1049 Failed to read descriptor from node connection: A device attached to the system is not functioning. (0x1F) When I manually visit the website and enter the tracking number and claim type, I can get past the continue button and on to the next screen where I will need to hit another continue button, as seen in the attached screen shot. For now, I am just trying to get past the first page.... Also, please see the attached chrome log file. Thank you again for your help! chrome.log -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Hi CYCho, The pages do not require logging in. Do you know how to create an incognito session? -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Thanks @CYCho I am now able to get back to the page, but there's another problem -- will you please check to see if you're having the same result? When I reach https://www.fedex.com/servlet/InvoiceServlet?link=4&jsp_name=adjustment&orig_country=US&language=english I click on FedEx Ground, "I received a FedEx invoice(Electronic or paper), then "Make a new request". When I do, I get an error: "Access to www.fedex.com was denied" $sElement_Ground_Radio = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr/td[3]/table[2]/tbody/tr/td[2]/form/table/tbody/tr/td/table/tbody/tr/td[2]/table[1]/tbody/tr[2]/td[1]/input") _WD_ElementAction($sSession, $sElement_Ground_Radio, 'click') $sElement_Pay_Radio = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr/td[3]/table[2]/tbody/tr/td[2]/form/table/tbody/tr/td/table/tbody/tr/td[2]/table[2]/tbody/tr[1]/td[3]/input") _WD_ElementAction($sSession, $sElement_Pay_Radio, 'click') $sElement_Submit_Radio = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div/div[2]/div/table/tbody/tr[2]/td/table/tbody/tr/td[3]/table[2]/tbody/tr/td[2]/form/table/tbody/tr/td/table/tbody/tr/td[2]/table[3]/tbody/tr[1]/td/input") _WD_ElementAction($sSession, $sElement_Submit_Radio, 'click') -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Back to not working -- is your script still working @CYCho ? -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Excellent -- that worked! Thank you Now I just need to figure out how to get it to work with Firefox.....if that's too challenging, I'll update the code to work with Chrome. -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
I get the same result (We're sorry, we can't process your request at this time), with your code, in Chrome. Is there a function that will delete all cookies in Firefox? Edit: found it: _WD_Cookies($sSession,'delete') I added that after the session is created and I still get the same result. -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Thank you very much CYCho. Have you also attempted with FireFox? -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Thanks for trying Danp2. Does anyone else have suggestions? -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Thanks for the reply Danp2. Do you have any suggestions on what I should do. Would you share what you are using for $sDesiredCapabilities? btw, I am using FireFox Thanks -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Thanks for the reply Danp2. Is it working for you when you initially navigate to the main page? Neither of these work for me. _WD_Navigate($sSession, "https://www.fedex.com") _WD_Navigate($sSession, "https://www.fedex.com/servlet/InvoiceServlet?link=4&jsp_name=adjustment&orig_country=US&language=english") _WD_Navigate($sSession, "https://www.fedex.com") _WD_Navigate($sSession, "https://www.fedex.com/en-us/customer-support/claims.html") $sLink = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[2]/div[4]/div[2]/div[1]/div[1]/div/div[1]/div[2]/div/a") _WD_ElementAction($sSession, $sLink, 'click') -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Hi Danp2, Sorry....I should have done that -- it was such a brief example, I thought my explanation covered it. Below is the snippet of code I am trying: _WD_Navigate($sSession, "https://www.fedex.com/servlet/InvoiceServlet?link=4&jsp_name=adjustment&orig_country=US&language=english") This code above navigates to a generic FedEx page -- not the intended page (undesired_result.png) that I can navigate to manually (desired_result.png). Second attempt is to go to the parent page and click on a link vs trying to directly navigate (above example): _WD_Navigate($sSession, "https://www.fedex.com/en-us/customer-support/claims.html") $sLink = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "/html/body/div[2]/div[4]/div[2]/div[1]/div[1]/div/div[1]/div[2]/div/a") _WD_ElementAction($sSession, $sLink, 'click') Both attempts give the same result. Please see the attached images. -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
Hello all, Thanks in advance for any help on this issue. I am using Selenium Webdriver + geckodriver-v0.26.0-win64 and it looks like the site I am visiting has changed something and now detects that I am using an automated script. I used to be able to simply navigate (using _WD_Navigate) to the URL below, but now I get redirected to a generic screen (not the intended target). https://www.fedex.com/servlet/InvoiceServlet?link=4&jsp_name=adjustment&orig_country=US&language=english I have attempted to go upstream, to the page that references the URL above, and click (_WD_ElementAction) the link, but get the same result. Parent URL: https://www.fedex.com/en-us/customer-support/claims.html Link Text: GO TO FEDEX EXPRESS OR FEDEX GROUND Link References: https://www.fedex.com/servlet/InvoiceServlet?link=4&jsp_name=adjustment&orig_country=US&language=english On the Parent URL link above, there looks to be the following onclick events (not sure if that helps or not): function() { if (this.href.indexOf("#") > -1) { var b = this.href.substring(this.href.indexOf("#"), this.href.length) } anchorLink(b) } function() { var a = $(this).attr("targetid"); if (a) { sessionStorage.setItem("target", a) } } function onclick(event) { FDX.DTM.pushLinkInfo(this) } -
WebDriver UDF (W3C compliant version) - 2024/09/21
NSearch replied to Danp2's topic in AutoIt Example Scripts
I am not attempting to circumvent or break any security protocols -- in fact, I will say, it is impossible to do so on the captcha they use. I am simply trying to enter the Captcha (manually) into a GUI and have the GUI insert it into the input box. Why am I doing this? So that I do not have to copy and paste the tracking and invoice numbers into the screen. The input boxes for those have no issue accepting the values I send.