Jump to content

rlvitorino

Active Members
  • Posts

    36
  • Joined

  • Last visited

Everything posted by rlvitorino

  1. Basically I'm trying to make this call via autoit, for postman it would be something like this: So it would return a token in the json to be able to use it, but it is returning blank. Has anyone had this problem ?
  2. $strURL = "https://XXXXXXX.XXXXXX.com/XXXXXXXX/rest/authenticate" $sBody = 'username=XXXXXX&password=XXXXXXXXXXX' $WinHttpReq = ObjCreate("Microsoft.XMLHTTP") # Create an HTTP request. $Temp = $WinHttpReq.Open("POST", $strURL, False) # headers $WinHttpReq.SetRequestHeader("Accept","application/text") $WinHttpReq.SetRequestHeader("Content-type", "multipart/form-data") # Send the HTTP request. $WinHttpReq.Send($sBody) # Wait for the response. $WinHttpReq.WaitForResponse(); # Retrieve the response text. $strResult = $WinHttpReq.ResponseText ConsoleWrite($WinHttpReq.ResponseBody) MsgBox("","Resultado",$strResult) MsgBox("","Resultado",$WinHttpReq.Status) MsgBox("","Resultado",$WinHttpReq.StatusText) I'm trying to execute an API call, but the return is always empty, I've tested other calls and the values are coming normally, does anyone know what it could be? Return is 200 but ResponseText or ResponseBody is empty. Trying with Objects :"WinHttp.WinHttpRequest.5.1" AND "Microsoft.XMLHTTP"
  3. Reason why I sent it here is that I really couldn't, but that's ok thanks!
  4. @Danp2 What I'm looking to do is in this link. https://docs.microsoft.com/en-us/microsoft-edge/webdriver-chromium/ie-mode?tabs=python I would like to do this in webdriver with autoit. You can access pages by emulating Internet Explorer on EDGE, without using IE.
  5. Is there an example of how to use the "attach to edge chrome" command using Internet explorer in Edge??
  6.   I convert to number before adding array. I've concatenated another column to addArray Number(StringStripWS($Match[0],$STR_STRIPALL)) _ArrayAdd($aResult ,Number(StringStripWS($Match[0],$STR_STRIPALL)) & "|" & StringStripWS(StringReplace(StringReplace(StringReplace($aFiles[$i],"result ",""),"(",""),").png",""), $STR_STRIPALL)) _ArrayDisplay($aResult,"")
  7. I use these commands, but it doesn't sort column 0, value 27 should be first. Global $aSortData[][] = [[0, 0]]
  8. autoit-chrome-native-messaging-host_.au3 AU3 autoit-chrome-native-messaging-host_.au3
  9. I am trying automation CALC, for study how use UIAutomation. this error is happening i don't know why #include "CUIAutomation2.au3" Func Num($number) Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation) Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement($pDesktop) $oDesktop = ObjCreateInterface($pDesktop, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) Local $pCondition $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, "ApplicationFrameWindow", $pCondition) Local $pCalc, $oCalc $oDesktop.FindFirst($TreeScope_Descendants, $pCondition, $pCalc) $oCalc = ObjCreateInterface($pCalc, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, 'Windows.UI.Core.CoreWindow', $pCondition) Local $pCalc1, $oCalc1 $oCalc.FindFirst($TreeScope_Descendants, $pCondition, $pCalc1) $oCalc1 = ObjCreateInterface($pCalc1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, 'LandmarkTarget', $pCondition) Local $pGroup, $oGroup $oCalc1.FindFirst($TreeScope_Descendants, $pCondition, $pGroup) $oGroup = ObjCreateInterface($pGroup, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_AutomationIdPropertyId, 'NumberPad', $pCondition) Local $pGroup2, $oGroup2 $oGroup.FindFirst($TreeScope_Descendants, $pCondition, $pGroup2) $oGroup2 = ObjCreateInterface($pGroup2, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_AutomationIdPropertyId, $number, $pCondition) Local $pButton, $oButton $oGroup2.FindFirst($TreeScope_Descendants, $pCondition, $pButton) $oButton = ObjCreateInterface($pButton, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) Local $pInvoke, $oInvoke $oButton.GetCurrentPattern($UIA_InvokePatternId, $pInvoke) $oInvoke = ObjCreateInterface($pInvoke, $sIID_IUIAutomationInvokePattern, $dtagIUIAutomationInvokePattern) $oInvoke.Invoke() EndFunc ;==>Num Func Operators($Operators) Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation) Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement($pDesktop) $oDesktop = ObjCreateInterface($pDesktop, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) Local $pCondition $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, "ApplicationFrameWindow", $pCondition) Local $pCalc, $oCalc $oDesktop.FindFirst($TreeScope_Descendants, $pCondition, $pCalc) $oCalc = ObjCreateInterface($pCalc, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, 'Windows.UI.Core.CoreWindow', $pCondition) Local $pCalc1, $oCalc1 $oCalc.FindFirst($TreeScope_Descendants, $pCondition, $pCalc1) $oCalc1 = ObjCreateInterface($pCalc1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, 'LandmarkTarget', $pCondition) Local $pGroup, $oGroup $oCalc1.FindFirst($TreeScope_Descendants, $pCondition, $pGroup) $oGroup = ObjCreateInterface($pGroup, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_AutomationIdPropertyId, 'StandardOperators', $pCondition) Local $pGroup2, $oGroup2 $oGroup.FindFirst($TreeScope_Descendants, $pCondition, $pGroup2) $oGroup2 = ObjCreateInterface($pGroup2, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_AutomationIdPropertyId, $Operators, $pCondition) Local $pButton, $oButton $oGroup2.FindFirst($TreeScope_Descendants, $pCondition, $pButton) $oButton = ObjCreateInterface($pButton, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) Local $pInvoke, $oInvoke $oButton.GetCurrentPattern($UIA_InvokePatternId, $pInvoke) $oInvoke = ObjCreateInterface($pInvoke, $sIID_IUIAutomationInvokePattern, $dtagIUIAutomationInvokePattern) $oInvoke.Invoke() EndFunc ;==>Operators Func GetResult() Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation) Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement($pDesktop) $oDesktop = ObjCreateInterface($pDesktop, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) Local $pCondition $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, "ApplicationFrameWindow", $pCondition) Local $pCalc, $oCalc $oDesktop.FindFirst($TreeScope_Descendants, $pCondition, $pCalc) $oCalc = ObjCreateInterface($pCalc, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, 'Windows.UI.Core.CoreWindow', $pCondition) Local $pCalc1, $oCalc1 $oCalc.FindFirst($TreeScope_Descendants, $pCondition, $pCalc1) $oCalc1 = ObjCreateInterface($pCalc1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId, 'LandmarkTarget', $pCondition) Local $pGroup, $oGroup $oCalc1.FindFirst($TreeScope_Descendants, $pCondition, $pGroup) $oGroup = ObjCreateInterface($pGroup, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oUIAutomation.CreatePropertyCondition($UIA_AutomationIdPropertyId, 'CalculatorResults', $pCondition) Local $pGroup2, $oGroup2 $oGroup.FindFirst($TreeScope_Descendants, $pCondition, $pGroup2) $oGroup2 = ObjCreateInterface($pGroup2, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) ;~ $oUIAutomation.CreatePropertyCondition($UIA_AutomationIdPropertyId, 'TextContainer', $pCondition) $oUIAutomation.CreatePropertyCondition($UIA_ClassNamePropertyId,'ScrollViewer', $pCondition) Local $pTextContainer, $oTextContainer, $Value $oGroup2.FindFirst($TreeScope_Descendants, $pCondition, $pTextContainer) $oTextContainer = ObjCreateInterface($pTextContainer, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) Local $pInvokePattern, $oInvokePattern $oTextContainer.GetCurrentPattern( $UIA_InvokePatternId, $pInvokePattern ) $oInvokePattern = ObjCreateInterface( $pInvokePattern, $sIID_IUIAutomationInvokePattern, $dtagIUIAutomationInvokePattern ) $oInvokePattern.Invoke() $oTextContainer.GetCurrentPropertyValue($UIA_NamePropertyId, $Value) Return $Value EndFunc ;==>GetResult Run("calc") Sleep(2000) WinWaitActive("Calculadora", "", 5) Num("num1Button") Num("num2Button") Num("num3Button") Num("num4Button") Num("num5Button") Num("num6Button") Num("num7Button") ;~ Num("num8Button") Num("num9Button") Operators("multiplyButton") Num("num9Button") Operators('equalButton') MsgBox("", "", GetResult()) >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\resource\Desktop\AutoIt Library\exemploUIAutomate\TesteUIA2.au3" /UserParams +>20:24:31 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0 Keyboard:00010416 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0416) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\resource\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\resource\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:C:\Users\resource\Desktop\AutoIt Library\exemploUIAutomate\TesteUIA2.au3 +>20:24:31 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "C:\Users\resource\Desktop\AutoIt Library\exemploUIAutomate\TesteUIA2.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop "C:\Users\resource\Desktop\AutoIt Library\exemploUIAutomate\TesteUIA2.au3" (134) : ==> Variable must be of type "Object".: $oTextContainer.GetCurrentPattern( $UIA_InvokePatternId, $pInvokePattern ) $oTextContainer^ ERROR ->20:24:37 AutoIt3.exe ended.rc:1 +>20:24:37 AutoIt3Wrapper Finished. >Exit code: 1 Time: 6.717
  10. I need Help in it.Why does this error occur? #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 ;#AutoIt3Wrapper_UseX64=n ; If target application is running as 32 bit code #AutoIt3Wrapper_UseX64=y ; If target application is running as 64 bit code #include "CUIAutomation2.au3" Opt("MustDeclareVars", 1) Run("Calc") Sleep(1000) Example() Func Example() ; Cria UI Automation object Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation) If Not IsObj($oUIAutomation) Then Return ConsoleWrite("$oUIAutomation ERR" & @CRLF) ConsoleWrite("$oUIAutomation OK" & @CRLF) ; Get Desktop Element Local $pDesktop, $oDesktop $oUIAutomation.GetRootElement($pDesktop) $oDesktop = ObjCreateInterface($pDesktop, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) If Not IsObj($oDesktop) Then Return ConsoleWrite("$oDesktop ERR" & @CRLF) ConsoleWrite("$oDesktop OK" & @CRLF) ;Espera Jameça Calculator WinWaitActive("Calculator ‎- Calculator", "",5) ConsoleWrite("--- Procura Calculator Window ---" & @CRLF) ; --- Copy element info --- ;~ ; $UIA_ClassNamePropertyId Button ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_ClassNamePropertyId, "Button", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pButton1, $oButton1,$sIID_IUIAutomationElement8,$dtag_IUIAutomationElement8,$oParent $oParent.FindFirst( 4, $pCondition0, $pButton1 ) $oButton1 = ObjCreateInterface( $pButton1, $sIID_IUIAutomationElement8, $dtag_IUIAutomationElement8 ) If Not IsObj( $oButton1 ) Then Return ConsoleWrite( "$oButton1 ERR" & @CRLF ) ConsoleWrite( "$oButton1 OK" & @CRLF ) EndFunc ;==>Example >"C:\Users\x209080\Desktop\Notepad++\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Users\x209080\Desktop\Notepad++\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "C:\Users\x209080\Desktop\UIAExamples\TesteUIA.au3" /UserParams +>09:31:18 Starting AutoIt3Wrapper v.17.224.935.0 SciTE v.3.7.3.0 Keyboard:00010416 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Users\x209080\Desktop\Notepad++\AutoIt3\SciTE UserDir => C:\Users\x209080\Desktop\Notepad++\AutoIt3\SciTE\AutoIt3Wrapper >Running AU3Check (3.3.14.5) params:-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 from:C:\Users\x209080\Desktop\Notepad++\AutoIt3 input:C:\Users\x209080\Desktop\UIAExamples\TesteUIA.au3 +>09:31:19 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Users\x209080\Desktop\Notepad++\AutoIt3\autoit3_x64.exe "C:\Users\x209080\Desktop\UIAExamples\TesteUIA.au3" --> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop $oUIAutomation OK $oDesktop OK --- Procura Calculator Window --- --- Find window/control --- $pCondition0 OK "C:\Users\x209080\Desktop\UIAExamples\TesteUIA.au3" (47) : ==> Variable must be of type "Object".: $oParent.FindFirst( 4, $pCondition0, $pButton1 ) $oParent^ ERROR ->09:31:26 AutoIt3.exe ended.rc:1 +>09:31:26 AutoIt3Wrapper Finished. >Exit code: 1 Time: 9.801
  11. #include <Ie.au3> ;~ Set SciTEWindow Minimize WinSetState("Class:SciTEWindow","",@SW_MINIMIZE) ;~ Open IE $oIE = _IECreate("www.google.com") _IELoadWait($oIE,1,30000) ;~ Set Window IE >Google> Maximize WinSetState("Google","",@SW_MAXIMIZE) ;~ Get Object IE > inputs $oInput = _IETagNameGetCollection($oIE,"input") ;~ Get position IE Control\ $Position = ControlGetPos("Google","","Internet Explorer_Server1") ;~ Get Value position element jscript $bottom = $oInput(2).getBoundingClientRect().bottom $height = $oInput(2).getBoundingClientRect().height $left = $oInput(2).getBoundingClientRect().left $right = $oInput(2).getBoundingClientRect().right $top = $oInput(2).getBoundingClientRect().top $width = $oInput(2).getBoundingClientRect().width ;~ Calcule Position $x = $left + ($width/2) + $Position[0] $y = $top + ($height/2) + $Position[1] ;~ Activate Window IE for Click WinActivate("Google","") ;~ Click positon Calculate MouseClick("",$x,$y,1,Null)
  12. @Danp2 Ok, I'll delete,But the version I posted I know is running and has everything you need to run chromedriver.
  13. Everything you need to use WebDriver new version (Not Virus - Code Only and ChromeDriver)
  14. I would like to remove message from googlechrome being automated I inserted the following code, '{"capabilities": {"alwaysMatch": {"goog: chromeOptions": {"w3c": true, "args": ["start-maximized" , "- disable-infobars"]}}}} ' Can anybody help me ?
  15. yes, in this logic, for setvalue, getvalue, click´s and get tables by ID or Xpath. it would be possible?
  16. If you want to get a text by its index ID I would use which command?
  17. Last Access Bridge Explorer for download. Access.zip
  18. global $wintitle = "Java Control Panel" $winHandle = WinActivate($wintitle) $result = __isJavaWindow($winHandle) Global $vmId Global $ac global $sName = "Edit Site List..." global $sRole = "push button" __getAccessibleContextFromHWND($winHandle, $vmID, $ac) $re_ac = _JAB_getAccessibleContextByFindAll($vmId, $ac, $sName, $sRole) _JAB_singleAction($vmId, $re_ac) Very good code above worked very well, but when you click a button and open a window with that click, the click is locked until you finish this window would you avoid it? Could you click and fill in the id field? What would that look like?
  19. Sorry Jos, but nothing in this UDF its working in my PC.
  20. Nothing Works
  21. Yes, I analisy, but no success
  22. Would not you have the latest version of JAVA UDF this version that is in the link is giving many problems?
  23. would have a newer version for testing?
  24. I just run java.au3 and this error appeared.
×
×
  • Create New...