autoit

How to stop chrome's Select a certificate window

十年热恋 提交于 2019-12-22 12:57:21
问题 I'm working on a selenium project, and the system I need to test is using SSL certificate. Every time when try to login the we are getting this "Select a certificate" window. Which we cannot handle with webdriver. I have tried click on ok button using AutoItx as below. But the Send("{ENTER}") is not the best option continue with. if (AutoItX.WinWaitActive("data:, - Google Chrome", "", 10) == 0) { AutoItX.WinActivate("data:, - Google Chrome"); AutoItX.Send("{ENTER}"); } Is there a way to use

Search tree and select items

旧时模样 提交于 2019-12-22 01:43:38
问题 Do you know how to scan a tree and select an item. For example is the autoit help file. I expand all the tree and what it has to do next is scan the items with a "history" in its name. If true, it has to select it and sleep for 5 seconds and continue select the next item it finds until end loop. Global $hWnd = ControlGetHandle("[CLASS:HH Parent;TITLE:AutoIt Help]", "", "[CLASS:SysTreeView32; INSTANCE:1]") $hItemFound = _GUICtrlTreeView_FindItem($hWnd, "History",True) _GUICtrlTreeView

Search tree and select items

妖精的绣舞 提交于 2019-12-22 01:43:25
问题 Do you know how to scan a tree and select an item. For example is the autoit help file. I expand all the tree and what it has to do next is scan the items with a "history" in its name. If true, it has to select it and sleep for 5 seconds and continue select the next item it finds until end loop. Global $hWnd = ControlGetHandle("[CLASS:HH Parent;TITLE:AutoIt Help]", "", "[CLASS:SysTreeView32; INSTANCE:1]") $hItemFound = _GUICtrlTreeView_FindItem($hWnd, "History",True) _GUICtrlTreeView

Parse all the rows of a CSV file in a loop using AutoIt

我是研究僧i 提交于 2019-12-20 07:47:37
问题 I have the following code to read a .csv file that contains two rows of data. I do not know what is wrong with it. How can I improve it to read a .csv file with two rows of data? #include <GUIConstants.au3> #include <string.au3> $file = FileOpen("test.csv", 0) If $file = -1 Then MsgBox(0, "error", "File doesn't exist or can't be read") Exit EndIf $string = (FileReadLine($file, 1)) $input = StringSplit($string, ",", 1) $input = StringSplit($string, ",", 1) Local $value1 = $input[1]

How to add apostrophe (") to string?

放肆的年华 提交于 2019-12-20 05:26:08
问题 I have this AutoIt script: ControlFocus("Open", "", "Edit1") Sleep(500) ControlSetText("Open", "", "Edit1", $CmdLine[1]) Sleep(500) ControlClick("Open", "", "Button1") It types a file name inside a file selection window. I want to add " before and after my string (the string I send as command line argument to my script). I tried ControlSetText("Open", "", "Edit1", $CmdLine[1] & """) but this results into error: Unterminated string. . 回答1: Autoit uses pairs quotes to indicate a single instance

How to implement error handling?

烂漫一生 提交于 2019-12-20 04:56:18
问题 My AutoIt script generates an error that I want to handle. A way that any error goes to a custom function will also do. In VBA I use OnErrorGoTo , but I am unable to find something similar in AutoIt. My Code : Func Start() While 1 If ProcessExists ( "Photoshop.exe" ) <> 0 Then Sleep(5000) Else Local $sFile ="C:\Auto\CodeToBe\Batch\Image Process-50-2D v.2-" & $n & ".jsxbin" Local $iPID = ShellExecute($sFile) Sleep(10000) $n = $n+1 EndIf WEnd EndFunc An error will occur when $n exceeds the

Grid image values to 2D array

两盒软妹~` 提交于 2019-12-19 10:08:19
问题 I have a grid like the image below which I want to put in an array in this format: ;x = wall(black cells and grey boxes), s= start (red circle), g = goal(blue circle), 0 = available path(everything else) $data[5][5] = [["x","x","x","x","x"], _ ["x","s","0","x","x"], _ ["x","x","0","x","x"], _ ["x","x","0","g","x"], _ ["x","x","x","x","x"]] I thought I could use the colors but I'm not sure how. 回答1: looks like you have the view with fixed angles create function that converts screen position to

Simulate “Windows” key and “+” key to zoom in

笑着哭i 提交于 2019-12-19 04:05:08
问题 Windows 7 (finally) has built-in zoom feature for the screen. Hold down the "Windows" key and you can then use the "+" key to zoom in and the "-" key to zoom out. As a result I have been trying to simulate this combination. With AutoIt I have tried: 1) Send("{LWINDOWN}" & "+" & "{LWINUP}") 2) $x = Chr(43) Send("{LWINDOWN}" & $x & "{LWINUP}") 3) Send("#{+}") ;//works but it also sends "+" key 4) Send("{LWINDOWN}") Sleep(10) Send("+",1) Sleep(10) Send("{LWINUP}") None of those 4 steps work... I

Split large string

 ̄綄美尐妖づ 提交于 2019-12-17 03:45:27
问题 I have a long text which needs to be converted to small strings so I can include it to an AutoIt script. If I include multi-line text it shows error unterminated string . So I should have: "numbercharswillbe10" &_ "othernumbersofcharwillbe10" &_ etc.. How can I split it with & _ -delimiters? 回答1: String concatenation As per Documentation - Language Reference - Operators: & Concatenates/joins two strings. &= Concatenation assignment. Example: Global $g_sText = "Long " & "string " & "here." &

Autoit script is not taking id values from html pages when i am using IE10 windows8?

会有一股神秘感。 提交于 2019-12-14 04:14:26
问题 The following code takes values from html code in Ie9 but when run same script in Ie10 windows8 it not taking Id values and filling text boxes..here is my script $url = "https://190.198.14.15/" $formID = "" $formUID = "username" $uName = "admin" $formPID = "password" $pwd = "SeR^ER@iL0" $formSubmit = "ID_LOGON" ;Launch the Internet Explorer as a private session ShellExecute ("iexplore.exe", " -private about:blank", @programFilesDir & "\Internet Explorer\iexplore.exe", "open", @SW_MAXIMIZE)