Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/29/2018 in all areas

  1. Hello. A couple week ago i've started learning API Interface for different websites. In this fact sometimes you have to encode your "photo" or "document.body" to send request. Functions to encode and decode Base64 was already created by others. Unfortunately i have troubles with running it on Windows R 2008, also speed was terrible. I try to find alternative way to code data. I've read about Microsoft "XMLDOM" and created a one simple function to Encode / Decode data to base64binary, base64url Thanks for Ghads on Wordpress i coverted a part of his lines from VBscript to AutoIT ;============================================================================================================================== ; Function: base64($vCode [, $bEncode = True [, $bUrl = False]]) ; ; Description: Decode or Encode $vData using Microsoft.XMLDOM to Base64Binary or Base64Url. ; IMPORTANT! Encoded base64url is without @LF after 72 lines. Some websites may require this. ; ; Parameter(s): $vData - string or integer | Data to encode or decode. ; $bEncode - boolean | True - encode, False - decode. ; $bUrl - boolean | True - output is will decoded or encoded using base64url shema. ; ; Return Value(s): On Success - Returns output data ; On Failure - Returns 1 - Failed to create object. ; ; Author (s): (Ghads on Wordpress.com), Ascer ;=============================================================================================================================== Func base64($vCode, $bEncode = True, $bUrl = False) Local $oDM = ObjCreate("Microsoft.XMLDOM") If Not IsObj($oDM) Then Return SetError(1, 0, 1) Local $oEL = $oDM.createElement("Tmp") $oEL.DataType = "bin.base64" If $bEncode then $oEL.NodeTypedValue = Binary($vCode) If Not $bUrl Then Return $oEL.Text Return StringReplace(StringReplace(StringReplace($oEL.Text, "+", "-"),"/", "_"), @LF, "") Else If $bUrl Then $vCode = StringReplace(StringReplace($vCode, "-", "+"), "_", "/") $oEL.Text = $vCode Return $oEL.NodeTypedValue EndIf EndFunc ;==>base64
    1 point
  2. @Nareshm This isn't a forum where you can show up, make a request, and then expect someone to regurgitate some code for you. I gave you some hints in an attempt to point you in the right direction. There's lots of code posted on this forum that deals with _IETagNameGetCollection and traversing the collection of elements. There's also the help file examples. You need to make some effort to solve your own problem. Where is your code? Post it here even if it doesn't work. At least show us that you are making an attempt to implement a solution.
    1 point
  3. Why do you use the UIAutomation object to replace the methods? could it have been any com component. Not sure what you accomplish in AccArrays.au3. Could you do it with Anyway interesting thread and will read on more in detail on how to deal with this array udf.
    1 point
  4. Hi, So I am trying to automate an installer as per the customer requirements because he wants to see the buttons being clicked when he runs the script even though we can install this silently. This is my code *************************************************** Run("C:\\QA\\MVAutomation\\foo.exe") ;wait for window to be active ; WinWaitActive("Title1") Local $hWnd = Title1") WinActivate("Title1") ; maybe redundant ; click on Check box for license agreement ControlClick($hWnd, "", "Button2") ; click on install Button ControlClick($hWnd, "", "Button4") Local $hWnd2 = WinWait("Title2") WinActivate("Title2", "&Next") While ControlCommand( "Title2", "&Next", "Button1","IsEnabled","") = 0 Sleep(50) WEnd ControlFocus ( "Title2", "&Next", "Button1" ) ControlClick ( "Title2 Setup", "&Next", "Button1" ) ConsoleWrite("Initial window handle: " &$hWnd) ConsoleWrite("Active window handle: " &$hWnd2) ************************************************************ The thing that I am having issues is that it never clicks on the Button1 on the Second Screen (Title2). The installer has both windows open at this time but as you can see I have activated 'Title2" window When I use the Window Info tool and look at the handle for the Title1 window I can see is the same one as written here: ConsoleWrite("Initial window handle: " &$hWnd) BUT when I use the tool to look at the handle for the Title2 Window which has the button I want to click on is different from the one here: ConsoleWrite("Active window handle: " &$hWnd2) This leads me to believe that apparently the automation must be looking at the wrong handle and then can't see the button !!! Any leads or tips on this are greatly appreciated. Thank you
    0 points
×
×
  • Create New...