Jump to content

Dmp

Active Members
  • Posts

    30
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Dmp's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. Hello experts, I cannot determine why I am getting an error after I use the 'run' function to execute an excel marco. The macro runs successfully as result of the run code, however, after the macro has executed, the autoit script fails w/ the error below. "C:\User\Documents\tst-saveas-XXX.au3" (139) : ==> The requested action with this object has failed.: Local $iPIDXl = $oXlsmExcel.Run("RP_WB") Local $iPIDXl = $oXlsmExcel^ ERROR ->13:26:51 AutoIt3.exe ended.rc:1 +>13:26:51 AutoIt3Wrapper Finished. >Exit code: 1 Time: 58.71 Also, I've had to attach my autoit code specific to this issue below because I don't currently have permissions to upload a file to this site. 😞 Thank you much in advance. $oXlsmExcel = _Excel_Open(True, Default, Default, Default, True) Local $oWorkbook2 = _Excel_BookOpen($oXlsmExcel, $sMacroWbook) $oWorkbook3 = _Excel_BookAttach($sMacroWbook) WinActivate($oWorkbook2) Sleep(3000) ; $oXlsmExcel.Run("PivotTbleVBA.xlsm!RPIMOV_WB") Local $iPIDXl = $oXlsmExcel.Run("RPIMOV_WB") If @error Then MsgBox($MB_SYSTEMMODAL, "", "Error Running Macro" & $iPIDXl & @CRLF & "@error = " & @error & ", @extended = " & @extended) Else ProcessClose($iPIDXl) EndIf Sleep(8000) _Excel_BookClose($oWorkbook2)
  2. That did it... earlier, I had tried "$_WD_OPTION_Enabled" or $_WD_OPTION_Visible using BitOr, but for "_WD_FindElement," which didn't work, needless to say. Thank you again for another solution and insight into the WD tools.πŸ™‚πŸ‘
  3. I was actually referring to the Syntax ........: _WD_FindElement($sSession, $sStrategy, $sSelector[, $sStartNodeID = Default[, $bMultiple = Default[, $bShadowRoot = Default]]]) I thought perhaps rather than $bShadowRoot = Ture, a numerical value was a valid input in some manner. W/ Chrome, this line: Local $sElePsswd = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath,"//input[@id='Password']") has been working perfectly for some time, however, I now need to use Edge. I’ve only just started the transition to Edge, and I’m only having an issue w/ the Password element on the login page. Using _WD_FindElement with XPath works fine w/ all the other elements on the page. The url for the login page is https://apps.id-systems.com
  4. Should I be looking at including a line as such for the Password element? $sRoot = _WD_GetShadowRoot($sSession, $_WD_LOCATOR_ByCSSSelector, "#usercentrics-root")
  5. Unfortuntely, not finding and clicking the "Next" button element does not enable the display of the Password element and the Login button. Not knowledgeable in these matters, but it’s as though a sub-display is loaded when the Next button is clicked---is this a Shadow Dom? Is the β€œ2” value in the shadowRoot parameter in: _WD_FindElement ($WD_SESSION, $_WD_LOCATOR_ByXPath, "//input[@id='Password']", Default, Default, 2) a positional indicator? I commented out all the _WD_LoadWait_ lines, but I'm still getting the same: __WD_Post ==> No match [8] : HTTP status = 404 _WD_FindElement ==> No match [8] : Parameters: Strategy=xpath Selector=//input[@id='Password'] StartNodeID=Default Multiple=Default ShadowRoot=2
  6. Good question regarding the "submitlogin" element. There are 2 of these element used in the login process; the only difference between the two is the associated text. After the userName element is filled out, the "Next" button (submitlogin element) needs to be clicked to go on to the page displaying the Password textbox and Login button. The "submitlogin" element click you mentioned belongs to clicking the Next button. This is working w/out issues; however, trying to get a match for the Password element using _WD_FindElement is where I'm having an issue. I've attached the SelectorsHub info on the 2 "submitlogin" elements to better explain the set-up. I've looked wd_core for other Strategy options, but neither have worked: _WD_LOCATOR_ByLinkText, ..._ByPartialLinkText, ..._ByTagName. Func VPLogin() ; VP login: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Local $sEmailAddress = 'XXXXX@xxx.com' Local $sElement = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, "//input[@id='UserName']") Do Local $eaElement = _WD_ElementAction($WD_SESSION, $sElement, 'value', $sEmailAddress) $iResultUNme = @error Until $iResultUNme = $_WD_ERROR_Success ; Locate the "Next" button after Username input Local $sElement2 = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, "//input[@id='submitlogin']") _WD_WaitElement($WD_SESSION, $_WD_LOCATOR_ByXPath, "//input[@id='submitlogin']", Default, Default, 2) ; MsgBox($MB_SYSTEMMODAL, "", "Wait ended for Submit Login id", 5); For testing _WD_ElementAction($WD_SESSION, $sElement2, 'click') ; _WD_LoadWait($WD_SESSION, 2000) ; Locate the "Password" text field after Username input. then clicking on the Next button. ; Local $sElePsswd = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, "//input[@id='Password']", Default, Default, BitOR($_WD_OPTION_Visible, $_WD_OPTION_Enabled)) ; Local $sElePsswd = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByCSSSelector, "#Password") Local $sElePsswd = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath,"//input[@id='Password']") ; _WD_WaitElement($WD_SESSION, $_WD_LOCATOR_ByXPath, "//input[@id='Password']", Default, Default, 2) ; _WD_ElementAction($WD_SESSION, $sElePsswd, 'click') ; Used as Reference to try different locator options ; //input[@id='Password'] ; (//input[@id='Password'])[1] ; #Password ; Global Const $_WD_LOCATOR_ByCSSSelector = "css selector" ; Global Const $_WD_LOCATOR_ByXPath = "xpath" ; Global Const $_WD_LOCATOR_ByLinkText = "link text" ; Global Const $_WD_LOCATOR_ByPartialLinkText = "partial link text" ; Global Const $_WD_LOCATOR_ByTagName = "tag name"
  7. Hello WD UDF Team... I'm using Edge browser and I'm trying to find and click on the password textbox on a web login page, but _WD_FindElement does match the given locator text on the web page. I used SelectorsHub to inspect the page. BTW, the very same _WD_FindElement line w/ xPath works on Chrome. I attached an image of SelectorsHub inspection.     ; Locate the "Password" text field after Username input. then clicking on the Next button.     ; Local $sElePsswd = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath, "//input[@id='Password']", Default, Default, BitOR($_WD_OPTION_Visible, $_WD_OPTION_Enabled))     ; Local $sElePsswd = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByCSSSelector, "#Password")     Local $sElePsswd = _WD_FindElement($WD_SESSION, $_WD_LOCATOR_ByXPath,"//input[@id='Password']")     ; _WD_WaitElement($WD_SESSION, $_WD_LOCATOR_ByXPath, "//input[@id='Password']", Default, Default, 2) -----------------BELOW     "NO MATCH" OUTPUT IS FOR Strategy=css selector   Selector=#Password... _WD_FindElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//input[@id='UserName']   StartNodeID=Default   Multiple=Default   ShadowRoot=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_ElementAction ==> Success [0] : Parameters:   Command=value   Option=<masked> __WD_Post ==> Success [0] : HTTP status = 200 _WD_FindElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//input[@id='submitlogin']   StartNodeID=Default   Multiple=Default   ShadowRoot=Default _WD_WaitElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//input[@id='submitlogin']   Delay=Default   Timeout=Default   Options=2 __WD_Post ==> Success [0] : HTTP status = 200 _WD_ElementAction ==> Success [0] : Parameters:   Command=click   Option=Default __WD_Post ==> No match [8] : HTTP status = 404 _WD_FindElement ==> No match [8] : Parameters:   Strategy=css selector   Selector=#Password   StartNodeID=Default   Multiple=Default   ShadowRoot=Default __WD_Post ==> No match [8] : HTTP status = 404 _WD_ElementAction ==> No match [8] : Parameters:   Command=click   Option=Default _WD_LoadWait ==> Success [0 / 4] : Parameters:    Delay=2000    Timeout=Default    Element=Default    DesiredState=complete    : ReadyState= complete (Fully loaded) _WD_WaitElement ==> Invalid Expression [11] : Parameters:   Strategy=xpath   Selector=   Delay=Default   Timeout=Default   Options=2 __WD_Post ==> No match [8] : HTTP status = 404 _WD_ElementAction ==> No match [8] : Parameters:   Command=value   Option=<masked> __WD_Post ==> No match [8] : HTTP status = 404 _WD_ElementAction ==> No match [8] : Parameters:   Command=value   Option=<masked> -----------------BELOW     "NO MATCH" OUTPUT IS FOR Strategy=xpath   Selector=//input[@id='Password']... _WD_FindElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//input[@id='UserName']   StartNodeID=Default   Multiple=Default   ShadowRoot=Default __WD_Post ==> Success [0] : HTTP status = 200 _WD_ElementAction ==> Success [0] : Parameters:   Command=value   Option=<masked> __WD_Post ==> Success [0] : HTTP status = 200 _WD_FindElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//input[@id='submitlogin']   StartNodeID=Default   Multiple=Default   ShadowRoot=Default _WD_WaitElement ==> Success [0] : Parameters:   Strategy=xpath   Selector=//input[@id='submitlogin']   Delay=Default   Timeout=Default   Options=2 __WD_Post ==> Success [0] : HTTP status = 200 _WD_ElementAction ==> Success [0] : Parameters:   Command=click   Option=Default __WD_Post ==> No match [8] : HTTP status = 404 _WD_FindElement ==> No match [8] : Parameters:   Strategy=xpath   Selector=//input[@id='Password']   StartNodeID=Default   Multiple=Default   ShadowRoot=3 __WD_Post ==> No match [8] : HTTP status = 404 _WD_ElementAction ==> No match [8] : Parameters:   Command=click   Option=Default _WD_LoadWait ==> Success [0 / 4] : Parameters:    Delay=2000    Timeout=Default    Element=Default    DesiredState=complete    : ReadyState= complete (Fully loaded)
  8. Why won't the SciTE generated executable include the web driver directory and its UDF contents when I have it located in the AutoIt3 directory under Programs Files? I am assuming this is the case because when I run the executable, Chrome does not launch the defined website , however, the non-browser dependent code runs fine; whereas with the original au3 script, there are no issues launching Chrome and running my entire automation. Are there extra steps that need to taken in order to have the Web Driver directory included while running the SciTE compiler?
  9. Where on the forum can I indicate that your support is "first-rate?"
  10. Hello Danp2... returning to this subject, tried your _WD_SelectFiles UDF, however, I am still having issues either with the element's Xpath and, or the $sSelector. This is what I tried: _WD_SelectFiles($sSession, $_WD_LOCATOR_ByXPath, "//input[@id='fuFileName']//input[@name='fuFileName']", $sFilePath) Below is the XPath and the HTML for the File Upload Control element: ChroPath defined XPath using id; class; name: //input[@id='fuFileName'] <input type="file" name="fuFileName" id="fuFileName" style="width:300px;" xpath="1"> <input type="submit" name="btnUpload" value="Upload Excel File" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;btnUpload&quot;, &quot;&quot;, true, &quot;AddFiles&quot;, &quot;&quot;, false, false))" id="btnUpload" style="color:Maroon;font-family:Calibri;font-size:12pt;font-weight:bold;" xpath="1"> <span id="revFileName" style="font-size:15px;visibility:hidden;" xpath="1">Only files of types Excel is allowed</span> <span id="rfvFileName" style="font-size:15px;visibility:hidden;" xpath="1">File Name is Required</span> SciTE output: __WD_Post: URL=HTTP://127.0.0.1:9515/session/66a5f2e89ef6071146a5b153267e1bec/element; Data={"using":"xpath","value":"//input[@id='fuFileName']//input[@name='fuFileName']"} __WD_Post ==> No match [8] : HTTP status = 404 ResponseText={"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//input[@id='fuFileName']//input[@name='fuFileName']\"}\n (Session info: chrome=104.0.5112.102)","stacktrace":"Backtrace:\n\tOrdinal0 [0x009678B3+2193587]\n\tOrdinal0 [0x00900681+1771137]\n\tOrdinal0 [0x008141A8+803240]\n\tOrdinal0 [0x008424A0+992416]\n\tOrdinal0 [0x0084273B+993083]\n\tOrdinal0 [0x0086F7C2+1177538]\n\tOrdinal0 [0x0085D7F4+1103860]\n\tOrdinal0 [0x0086DAE2+1170146]\n\tOrdinal0 [0x0085D5C6+1103302]\n\tOrdinal0 [0x008377E0+948192]\n\tOrdinal0 [0x008386E6+952038]\n\tGetHandleVerifier [0x00C10CB2+2738370]\n\tGetHandleVerifier [0x00C021B8+2678216]\n\tGetHandleVerifier [0x009F17AA+512954]\n\tGetHandleVerifier [0x009F0856+509030]\n\tOrdinal0 [0x0090743B+1799227]\n\tOrdinal0 [0x0090BB68+1817448]\n\tOrdinal0 [0x0090BC55+1817685]\n\tOrdinal0 [0x00915230+1856048]\n\tBaseThreadInitThunk [0x7761FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77C27A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77C27A6E+238]\n"}} _WD_FindElement ==> No match [8] : Parameters: Strategy=xpath Selector=//input[@id='fuFileName']//input[@name='fuFileName'] StartNodeID=Default Multiple=Default ShadowRoot=Default
  11. My apologies, but I'm unclear about the target element (file to upload) ... how do I determine the $_WD_LOCATOR_ByXPath of the file?
  12. __WD_Post: URL=HTTP://127.0.0.1:9515/session/48fdc5dd36c0d4d45eb352c1e71a933f/element; Data={"using":"xpath","value":"//input[contains(@id, 'fuFileName')]"} __WD_Post ==> Success [0] : HTTP status = 200 ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"fe7afb87-400d-451b-96b1-45296e02db0a"}} _WD_FindElement ==> Success [0] : Parameters: Strategy=xpath Selector=//input[contains(@id, 'fuFileName')] StartNodeID=Default Multiple=Default ShadowRoot=Default __WD_Post: URL=HTTP://127.0.0.1:9515/session/48fdc5dd36c0d4d45eb352c1e71a933f/element/fe7afb87-400d-451b-96b1-45296e02db0a/click; Data={"id":"fe7afb87-400d-451b-96b1-45296e02db0a"} __WD_Post ==> Invalid argument [5] : HTTP status = 400 ResponseText={"value":{"error":"invalid argument","message":"invalid argument\n (Session info: chrome=104.0.5112.102)","stacktrace":"Backtrace:\n\tOrdinal0 [0x009678B3+2193587]\n\tOrdinal0 [0x00900681+1771137]\n\tOrdinal0 [0x00814070+802928]\n\tOrdinal0 [0x00839A76+957046]\n\tOrdinal0 [0x0085D7AC+1103788]\n\tOrdinal0 [0x00838C04+953348]\n\tOrdinal0 [0x0085D9C4+1104324]\n\tOrdinal0 [0x0086DAE2+1170146]\n\tOrdinal0 [0x0085D5C6+1103302]\n\tOrdinal0 [0x008377E0+948192]\n\tOrdinal0 [0x008386E6+952038]\n\tGetHandleVerifier [0x00C10CB2+2738370]\n\tGetHandleVerifier [0x00C021B8+2678216]\n\tGetHandleVerifier [0x009F17AA+512954]\n\tGetHandleVerifier [0x009F0856+509030]\n\tOrdinal0 [0x0090743B+1799227]\n\tOrdinal0 [0x0090BB68+1817448]\n\tOrdinal0 [0x0090BC55+1817685]\n\tOrdinal0 [0x00915230+1856048]\n\tBaseThreadInitThunk [0x7761FA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77C27A9E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77C27A6E+238]\n"}} _WD_ElementAction ==> Invalid argument [5] : Parameters: Command=click Option=Default
  13. Looking at Func _WD_SelectFiles($sSession, $sStrategy, $sSelector, $sFilename) .... so I can try this instead of having to contend w/ the file upload control, correct? ; select single file _WD_SelectFiles($sSession, $_WD_LOCATOR_ByXPath, "//section[@id='examples']//input[@name='uploadedfile']", @ScriptDir & "\Screen1.png")
  14. Question.au3 I removed the _WD_WaitElement lines, leaving only the _WD_FindElement code, however, I'm still having the same issue; in fact this is what I had written initially. _WD_FindElement ==> Success [0] : Parameters: Strategy=xpath Selector=//input[contains(@id, 'fuFileName')] StartNodeID=Default Multiple=Default ShadowRoot=3 __WD_Post ==> Invalid argument [5] : HTTP status = 400 _WD_ElementAction ==> Invalid argument [5] : Parameters: Command=click Option=Default
Γ—
Γ—
  • Create New...