Jump to content

taylansan

Active Members
  • Posts

    102
  • Joined

  • Last visited

Everything posted by taylansan

  1. Hi Guys, I want to highlight an item on my GUI: I prepared below code: ConsoleWrite(@CRLF & "Checkpoint 01" & @CRLF) $sSelector = "//h1[contains(text(),'Welcome to BSS')]" $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sSelector, Default, True) ConsoleWrite(@CRLF & "Checkpoint 02" & @CRLF) _WD_HighlightElements($sSession, $sElement, 3) ;3 - Highlight yellow rounded box + border dotted red If @error Then ConsoleWrite("Checkpoint 03 ERROR IS: " & @error & @CRLF) EndIf ConsoleWrite(@CRLF & "Checkpoint 04" & @CRLF) Find Element --> Failed Highlight Element --> Failed Checkpoint 01 __WD_Post: URL=HTTP://127.0.0.1:5555/session/e8400313055f3e527203269ed8b79caa/elements; Data={"using":"xpath","value":"\/\/h1[contains(text(),'Welcome to BSS')]"} __WD_Post ==> Success [0] : HTTP status = 200 ResponseText={"value":[]} _WD_FindElement ==> No match [8] : Parameters: Strategy=xpath Selector=//h1[contains(text(),'Welcome to BSS')] StartNodeID=Default Multiple=True ShadowRoot=Default Checkpoint 02 __WD_Post: URL=HTTP://127.0.0.1:5555/session/e8400313055f3e527203269ed8b79caa/execute/sync; Data={"script":"arguments[0].style='border: 2px dotted red; background: #FFFF66; border-radius: 5px; padding-left: 3px;'; return true;", "args":[{"element-6066-11e4-a52e-4f735466cecf":""}]} __WD_Post ==> No match [8] : HTTP status = 404 ResponseText={"value":{"error":"stale element reference","message":"stale element reference: element is not attached to the page document\n (Session info: chrome=99.0.4844.84)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00AD9943+2595139]\n\tOrdinal0 [0x00A6C9F1+2148849]\n\tOrdinal0 [0x00964528+1066280]\n\tOrdinal0 [0x00966E04+1076740]\n\tOrdinal0 [0x00966CBE+1076414]\n\tOrdinal0 [0x0096763A+1078842]\n\tOrdinal0 [0x009BC529+1426729]\n\tOrdinal0 [0x009AB9EC+1358316]\n\tOrdinal0 [0x009BBAF2+1424114]\n\tOrdinal0 [0x009AB806+1357830]\n\tOrdinal0 [0x00986086+1204358]\n\tOrdinal0 [0x00986F96+1208214]\n\tGetHandleVerifier [0x00C7B232+1658114]\n\tGetHandleVerifier [0x00D3312C+2411516]\n\tGetHandleVerifier [0x00B6F261+560433]\n\tGetHandleVerifier [0x00B6E366+556598]\n\tOrdinal0 [0x00A7286B+2173035]\n\tOrdinal0 [0x00A775F8+2192888]\n\tOrdinal0 [0x00A776E5+2193125]\n\tOrdinal0 [0x00A811FC+2232828]\n\tBaseThreadInitThunk [0x74EA3D05+18]\n\t(No symbol) [0x77089732]\n\t(No symbol) [0x77089705]\n"}} _WD_ExecuteScript ==> No match [8] : stale element reference: element is not attached to the page document (Session info: chrome=99.0.4844.84) _WD_HighlightElements ==> No match [8] : Parameters: Element= Method=3 Checkpoint 03 ERROR IS: 8 Checkpoint 04 I'm not sure if I can use "//h1[contains(text(),'Welcome to BSS')]" or I should change h1 to * "//*[contains(text(),'Welcome to BSS')]". I don't know what h1 means, and I don't know if it's supported. How can I highlight that Welcome to BSS text?
  2. This is my output: PID: 4692 0/1 PID: 32896 0/1 PID: 54672 PID: 12076 54672 (the third one) = This is the cmd that I manually opened and it's terminated after the script ends. 12076 (the last one) = This is created with your script. It's terminated after the script ends. The first two = I don't know them. I can't see in the task manager either. They still exist after the script ends. How do I know? Because when the script again, I got the same PID again. But it doesn't matter. Thanks guys. PID: 4692 0/1 PID: 32896 0/1 PID: 20912 PID: 2336
  3. Is there a way to use this? Because this one puts me into infinite loop: While ProcessExists("cmd.exe") ProcessClose("cmd.exe") WEnd
  4. Hi, I'm using vpn connection to a remote computer with a login user (idk if that's any important). I want to loop a process until it's closed completely. I'm just looping until the process is closed (for or while doesn't matter): Local $aProcessList = ProcessList("cmd.exe") For $i = 1 To $aProcessList[0][0] ConsoleWrite("PID: " & $aProcessList[$i][1] & @CRLF) ProcessClose($aProcessList[$i][0]) ;WinKill($aProcessList[$i][0]) If @error Then ConsoleWrite("Error is: " & @error & @CRLF) EndIf Next This is my output: PID: 5548 Error is: 2 PID: 29488 Error is: 2 PID: 47248 Error is: 2 When I check in the task manager, I can only see one cmd --> 47248: 1. But my script doesn't close this process. I checked the error code 2 (AdjustTokenPrivileges Failed), but couldn't go any further. 2. I cannot see other two cmd.exe (5548 + 29488) in the task manager either even if I click "show process from all users". 3. If I select 47248 manually click on "end process", it works, the process is closed. I put #RequireAdmin in the beginning (hoping), but that didn't work either. If there are other processes from other users, I don't want to terminate them. I only want to terminate the process that is under my user. If I just type ProcessClose(47248) in my script, then it closes. But I couldn't close it inside the loop. What am I missing?
  5. Because I didn't know how to set color to a list view. I was thinking to write something like ListView[1], ListView[2], ListView[3], etc. I didn't know -1 would work. Thank you
  6. This is what I'm trying to do: Until I reach the height of my list (that takes 3 inputs), everything is good and I can see every color as I input. However, when I set the 4th color as green (which exceeds the height of the list view), I get a scroll bar (that is okay), but all the colors are turned into the last color. Even more, I keep adding different colors and when I mouse wheel up / down, the colors in the upper section of the list change. If I increase my list height from 90 to something more, it doesn't matter. Whenever I reach the original height and the scroll bar appears, the next color changes everything input before. How can I prevent it? #include <GUIConstantsEx.au3> #include <GuiListView.au3> _colorGUI() Func _colorGUI() GUICreate("Color GUI", 350, 300) GUICtrlCreateLabel("Name", 10, 10, 30, 20) $hName = GUICtrlCreateInput("", 50, 10, 120, 20) GUICtrlCreateLabel("Color", 180, 10, 30, 20) $hColorCombo = GUICtrlCreateCombo("", 220, 10, 120, 20) GUICtrlSetData($hColorCombo, "RED|GREEN|BLUE") $hAddButton = GUICtrlCreateButton("Add", 125, 40, 100, 40) $hList = GUICtrlCreateListView("", 10, 100, 270, 90) _GUICtrlListView_InsertColumn($hList, 0, "Color", 140) _GUICtrlListView_InsertColumn($hList, 0, "Name", 100) ;set background color black GUICtrlSetBkColor($hList, 0x000000) GUISetState(@SW_SHOW) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $hAddButton ;check the invalid inputs If GUICtrlRead($hName) = "" Or GUICtrlRead($hColorCombo) = "" Then ContinueLoop EndIf ;set the color based on dropdown If GUICtrlRead($hColorCombo) = "RED" Then GUICtrlSetColor($hList, 0xFF0000) ElseIf GUICtrlRead($hColorCombo) = "GREEN" Then GUICtrlSetColor($hList, 0x00FF00) ElseIf GUICtrlRead($hColorCombo) = "BLUE" Then GUICtrlSetColor($hList, 0x0000FF) Else ;if not RGB set color white GUICtrlSetColor($hList, 0xFFFFFF) EndIf GUICtrlCreateListViewItem(GUICtrlRead($hName) & "|" & GUICtrlRead($hColorCombo), $hList) EndSwitch WEnd GUIDelete() EndFunc
  7. Hello, I want to change the color of a text inside the GUI list. I checked the default code for _GUICtrlListView_AddItem and _GUICtrlListView_SetTextColor, but that couldn't do what I want. Let's use the default example in _GUICtrlListView_SetTextColor and I want to set a different color for each item: If I change the color here, it is changing for all the items in the list. _GUICtrlListView_SetTextColor($idListview, $CLR_BLACK) I also found GUICtrlSetColor, but all of them are the same color. GUICtrlSetColor($idListview, $COLOR_YELLOW) I'm sure that I shouldn't use $idListview, and I should set one item inside list, but I don't know. How can I change the color of different items in the list?
  8. Both logging and ClipPut or storing the output in a new variable are semi-acceptable answers when everything is working good, but not complete. Let's say I'm a fan of ConsoleWrite and I have 10k ConsoleWrite lines in my code. Then I need to write a new line for log or ClipPut the output 10k times or setting the $sText = $sText & "whatever new output" to store it. ClipPut is kinda risky, because if I Ctrl+C something else accidentally, I will lose all my progress. Replacing ConsoleWrite with (or adding) logging is an option. So, how about Question-2? There's in an error in my 2nd example (there's a random number "1" in the middle of the code, and I get the error message obviously). _FileWriteLog needs two parameters; file name (okay) and a text to log. How _FileWriteLog can store the are shown in the 2nd example in case of an error? What text should I input there to log? "1"? or "~^"? We can't do that, because we don't know what error I'm going to get until we run the code. That's why I specifically mentioned the red box in the success and error case. I wanted to focus on the output given by Autoit itself. How can I get (or store) Autoit output (that blue green yellow red lines or the bottom half of the window) into a text? Is there a way to target the Autoit output directly?
  9. Hi Autoit, Is there a way that I can copy the output of ConsoleWrite without selecting C:\Program Files etc? Question-1: Let's say I have the below code For $i = 1 To 10 ConsoleWrite($i & @TAB) Next ConsoleWrite(@CRLF) This is my output: I only want to copy the red box area. In this example, I'm just counting the numbers from 1 to 10 and there are only two ConsoleWrite. If I had a lot of ConsoleWrite with multiple (thousands) of result, how can I copy? Or copy everything and do notepading? Question-2: How about if there's an error? The same code as above, but there's an unexpected number in the middle. Of course, the result will fail: For $i = 1 To 10 1 ConsoleWrite($i & @TAB) Next ConsoleWrite(@CRLF) But I want to copy this output in the red box: Both questions are similar but the idea is the same. I want to copy the content starting from ">Running AU3Check (3.3.16.1)" until "+>AutoIt3Wrapper Finished"
  10. Hello, I was checking to send control + C / A / V (copy / all / paste) and I found this topic: They said, they can have their key sticky sometimes. That's okay, that's not the problem. My question is: If I KEYDOWN, how can I check if that key is pressed and down? In the below small script you can see I used CTRL, but it can be any other key such as Alt or Shift. What condition should I write in the if statement so it will return true and I can see "Control is already down" in the console output? I will CTRLUP anyway, but I want to enter inside that if condition when the Ctrl is really down. Is there anyway to check this? Send("{CTRLDOWN}") If <condition to check if ctrl is really down> Then ConsoleWrite("Control is already down" & @CRLF) EndIf Send("{CTRLUP}")
  11. Yeah, I know that order will work. But if the script is allowing me to use in the way that I use, without any compile errors, then it should be fine. And you can see in the below example that, I'm not separating in different lines. The thing is, if I want to use any inbuilt function such as String Length: ConsoleWrite("Hello " & StringLen("abcdefg") & " B" & @CRLF) ConsoleWrite("END" & @CRLF) ;I'm not dividing the 1st line into 3 parts as you suggested: ;ConsoleWrite("Hello ") ;ConsoleWrite(StringLen("abcdefg")) ;ConsoleWrite(" B" & @CRLF) ;ConsoleWrite("END" & @CRLF) My output will be as below as expected, which is good and correct: Hello 7 B END Which makes me think that I can use my function inside the console write too. Assume that my function is not doing any arithmetic equation, just another console write: ConsoleWrite("Hello " & _write15() & " B" & @CRLF) ConsoleWrite("END" & @CRLF) Func _write15() ConsoleWrite("15") ;Return 5*3 EndFunc ;This gives the below output ;15Hello 0 B ;END If I change that _write15() function to Return("15"), that will work too. So, I'm confused where that 0 comes from when I call _write15 which has ConsoleWrite inside. Also writing that "15" in the beginning of the output is confusing too.
  12. Hello, I wanted to call a function inside ConsoleWrite: ConsoleWrite("Hello " & _write15() & " B" & @CRLF) ConsoleWrite("END" & @CRLF) Func _write15() ;ConsoleWrite("15") ConsoleWrite(5*3) EndFunc I was expecting this output: Hello 15 B END But what I got is: 15Hello 0 B END If I change the function like this, of course it will work (without calling function): ConsoleWrite("Hello " & 5*3 & " B" & @CRLF) ConsoleWrite("END" & @CRLF) Func _write15() ;ConsoleWrite("15") ConsoleWrite(5*3) EndFunc As you can see, ConsoleWrite executed the _write15() before writing Hello, even Hello comes before the function. In addition to that, there is a "0" in the middle of my output. I have no idea where it came from. Please note that: I know we can assign the output of _write15() to a variable and call that variable in ConsoleWrite or maybe some easy solutions. But the goal is to call the function within ConsoleWrite.
  13. Hello, I'm checking a formula as the following: (x / (x+y)) / ((x-1) / (x-1+y)) With this calculation, I'm trying to get exactly 0.5 (not 4.9999, not 5.0000001). So, I have my code as: ;Local $x = 3, $y = 1 ;Local $x = 15, $y = 6 Local $x = 85, $y = 35 $result = ($x / ($x + $y)) * (($x - 1) / ($x - 1 + $y)) ConsoleWrite("Output will be: " & $x & " " & $y & " --> " & $result & @CRLF) If $result = 0.5 Then ConsoleWrite("YES, we're inside IF" & @CRLF) Else ConsoleWrite("Noooo" & @CRLF) EndIf If I use the combination of (3,1) and (15,6) the result is exactly 0.5 and I can see the console "YES, we're inside IF". But the combination of (85,35) returns "Noooo". We can also see that all these three combinations are exactly 0.5: If I change the condition as below, then yeah, it will return. But I'm looking for the exact 0.5 value. ;If $result = 0.5 Then If $result > 0.4999999999 Then So, my question is: Why the combination of (85,35) didn't return "YES, we're inside IF" even the output shows as it's exactly 0.5? Notes / assumptions: We only support up to 15 decimals. These rational numbers are cut at 15th digit, so we can never calculate the exact value. This assumption can be wrong. Because: (3,1)'s 2nd multiplier (2/3) will return 0.666666666666667; but we're inside that if. (15,6)'s 2nd multiplier (14/20) will return 0.714285714285714; but we're inside that if again. (85,35)'s 1st multiplier (85/120) will return 0.708333333333333 and 2nd multiplier (84/119) will return 0.705882352941177; but we're not inside that if anymore. If I add a rounding with 15 digits, it will work: $result = Round(($x / ($x + $y)) * (($x - 1) / ($x - 1 + $y)), 15)
  14. Hello, I'm trying to call a Subscript using a Mainscript. This is my Mainscript: ;#pragma("AutoItExecuteAllowed", True) ConsoleWrite("Start Loop" & @CRLF) For $i = 1 To 3 ConsoleWrite("Looping..." & @CRLF) Sleep(1000) RunWait(@AutoItExe & " /AutoIt3ExecuteScript Subscript.au3") Next ConsoleWrite("Loop Finished" & @CRLF) This is my Subscript: _write15() ;ConsoleWrite("Hello" & @CRLF) MsgBox(0, "", "Hello") Func _write15() ;ConsoleWrite("15" & @CRLF) MsgBox(0, "", "15") EndFunc If I run exactly like above, it's working correctly. I can see the message boxes every time; first "Hello" and then "15". No problem at all. This is my output: +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. Start Loop Looping... Looping... Looping... +>18:07:37 AutoIt3.exe ended.rc:0 +>18:07:37 AutoIt3Wrapper Finished. BUT: If I comment MsgBox and open the ConsoleWrite in the Subscript, I cannot see "Hello" and "15" in the output window: _write15() ConsoleWrite("Hello" & @CRLF) ;MsgBox(0, "", "Hello") Func _write15() ConsoleWrite("15" & @CRLF) ;MsgBox(0, "", "15") EndFunc The output is the same as above: +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+BREAK to Stop. Start Loop Looping... Looping... Looping... Loop Finished +>18:10:45 AutoIt3.exe ended.rc:0 +>18:10:45 AutoIt3Wrapper Finished. Is there a way that I can see "Hello" and "15" as ConsoleWrite in the output window? What I'm expecting is something like this: Start Loop Looping... 15 Hello Looping... 15 Hello Looping... 15 Hello Loop Finished Side note-1: I don't want to use #include <Subscript.au3> because I want to change and edit the content of Subscript any time I want. If I include Subscript.au3, even if I change the content while the Mainscript is running, I cannot see the changes until I start Mainscript again. Side note-2: I found #pragma("AutoItExecuteAllowed", True) in some other topics, but I couldn't make use of it, so I commented it.
  15. @Danp2 Yeah, FileGetSize will get the file size. But I want to use DllCall to get the size. So, maybe we can try _WinAPI_GetFileSizeEx @pixelsearch In the help documentation, you are creating a new file to be used in _WinAPI_GetFileSizeEx. Let's say, I want to get the size of "autoit3.exe" which is around 900kb. This is stored (in my computer) in "C:\Program Files (x86)\AutoIt3\autoit3.exe" and we have a shortcut to reach this easily: @AutoItExe So, I tried this: 1 + 2 is working as expected because they are using FileGetSize. But I wanted to make it work for 3 + 4 + 5. So, I tried several random options: #include <WinAPIFiles.au3> ;Example 1 = OK Local $iFileSize = FileGetSize(@AutoItExe) ConsoleWrite("Example 1: " & $iFileSize & @CRLF) ;Example 2 = OK $iFileSize = 0 $iFileSize = FileGetSize("C:\Program Files (x86)\AutoIt3\autoit3.exe") ConsoleWrite("Example 2: " & $iFileSize & @CRLF) ;Example 3 = NOT OK Local $hFile = FileOpen(@AutoItExe) ;OR Local $hFile = FileOpen("C:\Program Files (x86)\AutoIt3\autoit3.exe") $iFileSize = 0 $iFileSize = FileGetSize($hFile) ConsoleWrite("Example 3: " & $iFileSize & @CRLF) ;Example 4 = NOT OK $iFileSize = 0 $iFileSize = _WinAPI_GetFileSizeEx($hFile) ConsoleWrite("Example 4: " & $iFileSize & @CRLF) ;Example 5 = NOT OK $iFileSize = 0 Local $aCall = DllCall("kernel32.dll", "bool", "GetFileSizeEx", "handle", $hFile, "int64*", 0) ConsoleWrite("Example 5: " & $aCall[2] & @CRLF) FileClose($hFile) My output is as the following: Example 1: 946776 Example 2: 946776 Example 3: 0 Example 4: -1 Example 5: 0 So, I think I couldn't send handle $hFile correctly. So: How can I send "C:\Program Files (x86)\AutoIt3\autoit3.exe" or @AutoItExe as the correct handle? I used FileOpen() to get the handle, is this the place where I did wrong? Should I use a different function to open and get the file? Which one is it? What if the file I'm looking for is a big file, like few GB? Do I still need to open them to assign as a handle? Because FileGetSize() doesn't use a handle. Please note the same as before; the goal for me is to use the DllCall function, not to get the file size by using FileGetSize().
  16. Hello Autoit, I'm very new to DllCall function, in fact never used it, but I'm just curious about it. I found @toasterking's awesome beginner friendly dll GUI: I searched for some easier functions (less input / less output parameters), and I found GetFileSize function (I didn't modify his code, just using the GUI): https://learn.microsoft.com/en-gb/windows/win32/api/fileapi/nf-fileapi-getfilesize So, this is what I did: The function itself is executing like this, but the output is 0 and -1 DllCall("kernel32.dll","int","GetFileSize","HANDLE","D:\DllCall GetFileSize Example.au3","DWORD*","$hello") Then, I tried to execute my script (very simple) and put it into D drive: ;DllCall("kernel32.dll", "int", "GetFileSize", "HANDLE", "D:\DllCall GetFileSize Example.au3") $aDllCallReturn = DllCall("kernel32.dll","int","GetFileSize","HANDLE","D:\DllCall GetFileSize Example.au3","DWORD*","$hello") For $i = 0 To UBound($aDllCallReturn) - 1 ConsoleWrite($i & ": " & $aDllCallReturn[$i] & @CRLF) ;MsgBox(0, $i, $aDllCallReturn[$i]) Next ;ConsoleWrite($hello & @CRLF) The result is as the following (same as the screenshot): 0: -1 1: 0x00000000 2: 0 This file size is 403 bytes in my computer, it's very small, I expected to see 403 somewhere, but I don't know where I made it wrong. So, now I have some questions: 1. Do I really need to use lpFileSizeHigh or can I use "hello"? 2. Do I always have to put $ in the beginning of the parameter? I tried without $ in his GUI, I got an error. So, I think $ is a must. 3. But if I write as $hello (expecting this will store the file size), when I ConsoleWrite it, Autoit becomes angry because "undeclared global variable". 4. If somehow $hello will be the output to my file size, why do I need to return an array $aDllCallReturn which contains 3 elements? So, I have one $hello + 3 items from the array = I have 4 outputs total. But Microsoft says this function has only one return "[out, optional] LPDWORD lpFileSizeHigh ". I'm confused. Please note that; the goal for me is to use the DllCall function, not to get the file size by using FileGetSize() or some other existing functions.
  17. Hello Again, I tried _WD_HighlightElement it's really useful Here you can see, I can highlight Export and one new specific item: And here ;This is the Export button ;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@class='mat-focus-indicator mat-raised-button mat-button-base mat-black ng-star-inserted']") ;This is the specific item in the screenshot ;$sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[normalize-space()='4300017905']") _WD_ElementAction($sSession, $sElement, "CLICK") The output for clicking the specific item is similar to the output that I had in the previous posts: __WD_Post: URL=HTTP://127.0.0.1:9515/session/6510768edc91f60dfccc40b33aefb868/element/a3dabaf0-e689-45a5-bafb-cc2c8fc33406/click; $sData={"id":"a3dabaf0-e689-45a5-bafb-cc2c8fc33406"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_ElementAction: {"value":null}... I also attached the page (I just Save As), but it seems that SelectorsHub can't work on the offline pages. (I don't know if sharing Zip file is allowed. If it's not allowed, sorry in advance, I couldn't think another way.) Stratus SaveAs.zip Unfortunately, even if I can highlight the Export or other element, the Click on that element didn't trigger the download page or didn't open the specific item. I start to believe that it's a restriction in the Webpage, or the program (Stratus) is not allowing to automate the things. Thanks for having a look at it.
  18. Hi @Danp2 I tried Action Ex. The result says it's success: ==== TY: finished navigate, starting find element ==== __WD_Post: URL=HTTP://127.0.0.1:9515/session/30f6cbbe19831293f2a25277716b0061/element; $sData={"using":"xpath","value":"//button[@class='mat-focus-indicator mat-raised-button mat-button-base mat-black ng-star-inserted']"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"7d4bd075-c21e-4915-9906-104c64643a5d"}}... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"7d4bd075-c21e-4915-9906-104c64643a5d"}} ==== TY: finished find element, starting click ==== _WD_JsonActionPointer: {"type":"pointerDown","button":0} _WD_JsonActionPointer: {"type":"pointerUp","button":0} __WD_Post: URL=HTTP://127.0.0.1:9515/session/30f6cbbe19831293f2a25277716b0061/actions; $sData={"actions":[{"id":"hover","type":"pointer","parameters":{"pointerType":"mouse"},"actions":[{"type":"pointerMove","duration":100,"x":0,"y":0,"origin":{"ELEMENT":"7d4bd075-c21e-4915-9906-104c64643a5d","element-6066-11e4-a52e-4f735466cecf":"7d4bd075-c21e-4915-9906-104c64643a5d"}},{"type":"pointerDown","button":0},{"type":"pointerUp","button":0}]}]} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_Action: {"value":null} _WD_ElementActionEx ==> Success ==== TY: finished click, exiting ==== __WD_Delete: URL=HTTP://127.0.0.1:9515/session/30f6cbbe19831293f2a25277716b0061 __WD_Delete: StatusCode=200; ResponseText={"value":null}... _WD_DeleteSession: {"value":null} But I didn't download the export file as if I would manually click.
  19. Hello, I have a problem while clicking on an element. I'm trying to click on this element: This is my code: #include "wd_helper.au3" #include "wd_capabilities.au3" #include "wd_capabilities.au3" $sDesiredCapabilities = SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://external.stratus.ms/purchase-order-collaboration?tab=neworamended") _myMsg("finished navigate, starting find element") ;_WD_Attach($sSession, "Stratus") $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//button[@class='mat-focus-indicator mat-raised-button mat-button-base mat-black ng-star-inserted']") _myMsg("finished find element, starting click") _WD_ElementAction($sSession, $sElement, "CLICK") _myMsg("finished click, exiting") _WD_DeleteSession($sSession) _WD_Shutdown() Func _myMsg($sMsg) ConsoleWrite(@CRLF & "==== TY: " & $sMsg & " ====" & @CRLF) MsgBox(0, "", $sMsg) EndFunc Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"]}}}}' Return $sDesiredCapabilities EndFunc And here's the error code: _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WD_Startup: OS: WIN_10 WIN32_NT 19043 _WD_Startup: AutoIt: 3.3.14.5 _WD_Startup: WD.au3: 0.5.1.1 (Up to date) _WD_Startup: WinHTTP: 1.6.4.2 _WD_Startup: Driver: chromedriver.exe _WD_Startup: Params: --verbose --log-path="C:\Users\rhuang30\OneDrive - Lenovo\Desktop\Script\Auto Stratus\chrome.log" _WD_Startup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\rhuang30\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"]}}}} __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"97.0.... _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"97.0.4692.99","chrome":{"chromedriverVersion":"97.0.4692.71 (adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247})","userDataDir":"C:\\Users\\rhuang30\\AppData\\Local\\Google\\Chrome\\User Data\\"},"goog:chromeOptions":{"debuggerAddress":"localhost:49750"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:virtualAuthenticators":true},"sessionId":"26d2afe70c6271b1270c8de8d1474e49"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/26d2afe70c6271b1270c8de8d1474e49/url; $sData={"url":"https://external.stratus.ms/purchase-order-collaboration?tab=neworamended"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_Navigate: {"value":null} ==== TY: finished navigate, starting find element ==== __WD_Post: URL=HTTP://127.0.0.1:9515/session/26d2afe70c6271b1270c8de8d1474e49/element; $sData={"using":"xpath","value":"//button[@class='mat-focus-indicator mat-raised-button mat-button-base mat-black ng-star-inserted']"} __WD_Post: StatusCode=200; ResponseText={"value":{"element-6066-11e4-a52e-4f735466cecf":"eb4e070c-0d5e-4d42-a80c-710da4d14830"}}... _WD_FindElement: {"value":{"element-6066-11e4-a52e-4f735466cecf":"eb4e070c-0d5e-4d42-a80c-710da4d14830"}} ==== TY: finished find element, starting click ==== __WD_Post: URL=HTTP://127.0.0.1:9515/session/26d2afe70c6271b1270c8de8d1474e49/element/eb4e070c-0d5e-4d42-a80c-710da4d14830/click; $sData={"id":"eb4e070c-0d5e-4d42-a80c-710da4d14830"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_ElementAction: {"value":null}... ==== TY: finished click, exiting ==== __WD_Delete: URL=HTTP://127.0.0.1:9515/session/26d2afe70c6271b1270c8de8d1474e49 __WD_Delete: StatusCode=200; ResponseText={"value":null}... _WD_DeleteSession: {"value":null} In my understanding, I found the element correctly. But when I want to click on it, I receive the message that value is null. I also tried to _WD_Attach again, before finding the element but that didn't help either. Is it me doing wrong and couldn't point the element? Or is it the page? One side note to mention: After I first navigate to "external.stratus.ms", I need to wait for several seconds. Because Chrome is going through Microsoft online to do some verification. I don't know if this this note is important to mention. First I wanted to click that "Export" button in the page, and then I will try to click the checkboxes shown in the screenshot. x
  20. Hello, In the GUICtrlCreateList default example, whenever I click the Add button I can see "You clicked button No1" is added into the list. But the list is always kept on the top (red arrows). I want to go the end of the list whenever I click the Add button (green arrows). This is the original example of GUICtrlCreateList (except the two commented lines which I added them). I know I need to add something after Case $idButton_Add: #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> Example() Func Example() Local $sMESSAGE = "The following buttons have been clicked" GUICreate("My GUI list") ; will create a dialog box that when displayed is centered Local $idButton_Add = GUICtrlCreateButton("Add", 64, 32, 75, 25) Local $idButton_Clear = GUICtrlCreateButton("Clear", 64, 72, 75, 25) Local $idMylist = GUICtrlCreateList("buttons that have been clicked", 176, 32, 121, 97) GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling GUICtrlSetData(-1, $sMESSAGE) Local $idButton_Close = GUICtrlCreateButton("my closing button", 64, 160, 175, 25) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton_Add GUICtrlSetData($idMylist, "You clicked button No1|") ;I think I need to add something here, to make the list jump to the last item ;GUICtrlSetState($idMylist, "go to the last item") Case $idButton_Clear GUICtrlSetData($idMylist, "") Case $idButton_Close MsgBox($MB_SYSTEMMODAL, "", "the closing button has been clicked", 2) Exit EndSwitch WEnd EndFunc ;==>Example I looked for the GUICtrlSetState function, but I couldn't find which parameter I should use to go to the last item in the list. I don't want to force send keys such as Send("{END}") which will of course go the last element. How can I go to the last item in the list? Is GUICtrlSetState function with a special parameter or a different function?
  21. Hi, I'm trying to use Webdriver with the current user profile. I tried these: $sDesiredCapabilities = SetupChrome2() _WD_Startup() _WD_Navigate($sSession, "https://www.youtube.com") Func SetupChrome1() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('args', 'user-data-dir', 'C:\Users\' & @UserName & '\AppData\Local\Google\Chrome\User Data\Default') ;This is Attempt1 _WD_CapabilitiesAdd('args', '--profile-directory', Default) ;This is Attempt1 _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sDesiredCapabilities = _WD_CapabilitiesGet() Return $sDesiredCapabilities EndFunc ;==>SetupChrome Func SetupChrome2() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"]}}}}' ;This is Attempt2 = It's from WIKI Return $sDesiredCapabilities EndFunc ;==>SetupChrome Func SetupChrome3() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"], "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false }}}}' ;This is Attempt3 = I found from the previous posts Return $sDesiredCapabilities EndFunc ;==>SetupChrome As you can see, I have 3 attemps: I added some parameters in _WD_CapabilitiesAdd: I can navigate to Youtube, but the profile didn't work I just copied WIKI profile wiki > WebDriver > FAQ #3: Chrome opened with my profile, but I couldn't navigate to Youtube I copied Capabilities from other users in the forum: Chrome opened with my profile, but I couldn't navigate to Youtube The output of 2 and 3 seemed very likely to each other. This is the output of 2, which I copied from WIKI: >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3" /UserParams +>00:55:15 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0 Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3 +>00:55:15 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WD_Startup: OS: WIN_10 WIN32_NT 19043 _WD_Startup: AutoIt: 3.3.14.5 _WD_Startup: WD.au3: 0.5.1.0 (Up to date) _WD_Startup: WinHTTP: 1.6.4.2 _WD_Startup: Driver: chromedriver.exe _WD_Startup: Params: --verbose --log-path="D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\chrome.log" _WD_Startup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":["--user-data-dir=C:\\Users\\T00722811\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"]}}}} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in ... __WD_Post ==> Invalid argument: {"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0096E75C+1173340]\n\tOrdinal0 [0x0096AFC1+1159105]\n\tOrdinal0 [0x0099C22F+1360431]\n\tOrdinal0 [0x0099BE9A+1359514]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_CreateSession: {"value":{"error":"invalid argument","message":"invalid argument: user data directory is already in use, please specify a unique value for --user-data-dir argument, or don't use --user-data-dir","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0096E75C+1173340]\n\tOrdinal0 [0x0096AFC1+1159105]\n\tOrdinal0 [0x0099C22F+1360431]\n\tOrdinal0 [0x0099BE9A+1359514]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_CreateSession ==> Webdriver Exception: HTTP status = 400 __WD_Post: URL=HTTP://127.0.0.1:9515/session//url; $sData={"url":"https://www.youtube.com"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOr... __WD_Post ==> Invalid session ID: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952CD0+1060048]\n\tOrdinal0 [0x00973190+1192336]\n\tOrdinal0 [0x00997A50+1342032]\n\tOrdinal0 [0x00995A18+1333784]\n\tOrdinal0 [0x009955B9+1332665]\n\tOrdinal0 [0x009352A7+938663]\n\tOrdinal0 [0x009357C3+939971]\n\tOrdinal0 [0x00935B0A+940810]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00935032+938034]\n\tOrdinal0 [0x00934A38+936504]\n\tGetHandleVerifier [0x00D2F50C+2495788]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_Navigate: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952CD0+1060048]\n\tOrdinal0 [0x00973190+1192336]\n\tOrdinal0 [0x00997A50+1342032]\n\tOrdinal0 [0x00995A18+1333784]\n\tOrdinal0 [0x009955B9+1332665]\n\tOrdinal0 [0x009352A7+938663]\n\tOrdinal0 [0x009357C3+939971]\n\tOrdinal0 [0x00935B0A+940810]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00935032+938034]\n\tOrdinal0 [0x00934A38+936504]\n\tGetHandleVerifier [0x00D2F50C+2495788]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_Navigate ==> Invalid session ID: HTTP status = 404 __WD_Delete: URL=HTTP://127.0.0.1:9515/session/ __WD_Delete: StatusCode=200; ResponseText={"value":null}... _WD_DeleteSession: {"value":null} +>00:55:19 AutoIt3.exe ended.rc:0 +>00:55:19 AutoIt3Wrapper Finished. >Exit code: 0 Time: 4.337 It's telling me to remove user-data-dir parameter. If I remove it, I can navigate but I can't use my profile. What did I do wrong that in Attempt 2 that my profile is loaded, but I couldn't navigate?
  22. I didn't know SelectorsHub, this really helps now. After installing it, something came to my eye that the driver (chromedriver) starts a completely new Chrome without taking any extensions or bookmarks. This questions is not related to the code, it's somehow related to the driver. If you don't reply, it's fine too. This is just double-clicking Chrome, I can see my bookmarks and extensions: But when I run Chrome using chromedriver, it acts like a completely new and untouched browser; no bookmarks and no extensions from the original: After installing SelectorsHub in Chrome launched by chromedriver and closing it, then re-launching another chromedriver: I can't see SelectorsHub anymore either. How can I force chromedriver to run Chrome with the existing settings (with the bookmarks + extensions)?
  23. Hello @Danp2 I wanted to click the "Subscriptions" in the Youtube page. As a first step, I inspected the page and found the details: Screenshot cannot show properly, this is the details of the element: <a id="endpoint" tabindex="-1" class="yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer" title="Subscriptions" href="/feed/subscriptions"> <yt-icon id="icon" class="guide-icon style-scope ytd-mini-guide-entry-renderer"><svg viewBox="0 0 24 24" preserveAspectRatio="xMidYMid meet" focusable="false" class="style-scope yt-icon" style="pointer-events: none; display: block; width: 100%; height: 100%;"><g class="style-scope yt-icon"><path d="M10,18v-6l5,3L10,18z M17,3H7v1h10V3z M20,6H4v1h16V6z M22,9H2v12h20V9z M3,10h18v10H3V10z" class="style-scope yt-icon"></path></g></svg><!--css-build:shady--></yt-icon> <span class="title style-scope ytd-mini-guide-entry-renderer">Subscriptions</span> <tp-yt-paper-tooltip animation-delay="0" offset="4" position="right" class="style-scope ytd-mini-guide-entry-renderer" role="tooltip" tabindex="-1" hidden="" style="--paper-tooltip-delay-in:0ms;"><!--css-build:shady--><div id="tooltip" class="style-scope tp-yt-paper-tooltip hidden"> Subscriptions </div> </tp-yt-paper-tooltip> <yt-interaction class="style-scope ytd-mini-guide-entry-renderer"><!--css-build:shady--><div class="stroke style-scope yt-interaction"></div><div class="fill style-scope yt-interaction"></div></yt-interaction> </a> Without knowing too much, I check that: It starts with "a" It has class named as "yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer" It has title as "Subscriptions" So, I created my code, filling all these informations: #include "wd_core.au3" #include "wd_helper.au3" #include "wd_capabilities.au3" $sDesiredCapabilities = SetupChrome() _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://www.youtube.com") $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']") _WD_ElementAction($sSession, $sElement, 'click') MsgBox(0,"","") _WD_DeleteSession($sSession) _WD_Shutdown() Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--verbose --log-path="' & @ScriptDir & '\chrome.log"') ;~ Local $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"]}}}}' _WD_CapabilitiesStartup() _WD_CapabilitiesAdd('alwaysMatch', 'chrome') _WD_CapabilitiesAdd('w3c', True) _WD_CapabilitiesAdd('excludeSwitches', 'enable-automation') _WD_CapabilitiesDump(@ScriptLineNumber) ; dump current Capabilities setting to console - only for testing in this demo Local $sDesiredCapabilities = _WD_CapabilitiesGet() Return $sDesiredCapabilities EndFunc ;==>SetupChrome When I look at my $sElement, it seemed like it's too big, and I'm not sure if the browser can find the element I wrote in the path. Yet it didn't: >"C:\Program Files (x86)\AutoIt3\SciTE\..\AutoIt3.exe" "C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.au3" /run /prod /ErrorStdOut /in "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3" /UserParams +>00:00:30 Starting AutoIt3Wrapper v.19.102.1901.0 SciTE v.4.1.2.0 Keyboard:00000409 OS:WIN_10/ CPU:X64 OS:X64 Environment(Language:0409) CodePage:0 utf8.auto.check:4 +> SciTEDir => C:\Program Files (x86)\AutoIt3\SciTE UserDir => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE\AutoIt3Wrapper SCITE_USERHOME => C:\Users\T00722811\AppData\Local\AutoIt v3\SciTE >Running AU3Check (3.3.14.5) from:C:\Program Files (x86)\AutoIt3 input:D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3 +>00:00:30 AU3Check ended.rc:0 >Running:(3.3.14.5):C:\Program Files (x86)\AutoIt3\autoit3.exe "D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\00 my wd.au3" +>Setting Hotkeys...--> Press Ctrl+Alt+Break to Restart or Ctrl+Break to Stop ! @ScriptLineNumber = 297 ! _WD_Capabilities: API START: 32 - $_WD_CAPS__API: Rows= 1 - $_WD_CAPS__API: Cols= 12 alwaysMatch|||-1||goog:chromeOptions||-1||||0 ! _WD_Capabilities: API END: 32 ! _WD_Capabilities: JSON START: 32 { "capabilities":{ "alwaysMatch":{ "goog:chromeOptions":{ "w3c":true, "excludeSwitches":[ "enable-automation" ] } } } } ! _WD_Capabilities: JSON END: 32 _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WD_Startup: OS: WIN_10 WIN32_NT 19043 _WD_Startup: AutoIt: 3.3.14.5 _WD_Startup: WD.au3: 0.5.1.0 (Up to date) _WD_Startup: WinHTTP: 1.6.4.2 _WD_Startup: Driver: chromedriver.exe _WD_Startup: Params: --verbose --log-path="D:\Taylan\Projects\AU3\Test\Edge\WebDriver-0.5.1.0\chrome.log" _WD_Startup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={ "capabilities":{ "alwaysMatch":{ "goog:chromeOptions":{ "w3c":true, "excludeSwitches":[ "enable-automation" ] } } } } __WD_Post: StatusCode=200; ResponseText={"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"97.0.... _WD_CreateSession: {"value":{"capabilities":{"acceptInsecureCerts":false,"browserName":"chrome","browserVersion":"97.0.4692.71","chrome":{"chromedriverVersion":"97.0.4692.71 (adefa7837d02a07a604c1e6eff0b3a09422ab88d-refs/branch-heads/4692@{#1247})","userDataDir":"C:\\Users\\T00722~1\\AppData\\Local\\Temp\\scoped_dir40888_615928999"},"goog:chromeOptions":{"debuggerAddress":"localhost:57086"},"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platformName":"windows","proxy":{},"setWindowRect":true,"strictFileInteractability":false,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unhandledPromptBehavior":"dismiss and notify","webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:virtualAuthenticators":true},"sessionId":"d5c403dd6f40c1ff1471f913cae480ab"}} __WD_Post: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab/url; $sData={"url":"https://www.youtube.com"} __WD_Post: StatusCode=200; ResponseText={"value":null}... _WD_Navigate: {"value":null} __WD_Post: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab/element; $sData={"using":"xpath","value":"//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']"} __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\":\"//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']\"}\n (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097E49E+1238174]\n\tOrdinal0 [0x0097E69B+1238683]\n\tOrdinal0 [0x009A9252+1413714]\n\tOrdinal0 [0x00997B54+1342292]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_FindElement: {"value":{"error":"no such element","message":"no such element: Unable to locate element: {\"method\":\"xpath\",\"selector\":\"//a[class='yt-simple-endpoint style-scope ytd-mini-guide-entry-renderer' and title='Subscriptions']\"}\n (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097E49E+1238174]\n\tOrdinal0 [0x0097E69B+1238683]\n\tOrdinal0 [0x009A9252+1413714]\n\tOrdinal0 [0x00997B54+1342292]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_FindElement ==> No match: HTTP status = 404 __WD_Post: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab/element//click; $sData={"id":""} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n (Ses... __WD_Post ==> No match: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097DC11+1235985]\n\tOrdinal0 [0x0097FC4E+1244238]\n\tOrdinal0 [0x00974ED6+1199830]\n\tOrdinal0 [0x00997B0C+1342220]\n\tOrdinal0 [0x00974984+1198468]\n\tOrdinal0 [0x00997C14+1342484]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} _WD_ElementAction: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n (Ses... _WD_ElementAction ==> No match: {"value":{"error":"no such element","message":"no such element: Element_id length is invalid\n (Session info: chrome=97.0.4692.71)","stacktrace":"Backtrace:\n\tOrdinal0 [0x00ABFDC3+2555331]\n\tOrdinal0 [0x00A577F1+2127857]\n\tOrdinal0 [0x00952E08+1060360]\n\tOrdinal0 [0x0097DC11+1235985]\n\tOrdinal0 [0x0097FC4E+1244238]\n\tOrdinal0 [0x00974ED6+1199830]\n\tOrdinal0 [0x00997B0C+1342220]\n\tOrdinal0 [0x00974984+1198468]\n\tOrdinal0 [0x00997C14+1342484]\n\tOrdinal0 [0x009A75FA+1406458]\n\tOrdinal0 [0x00997976+1341814]\n\tOrdinal0 [0x009736B6+1193654]\n\tOrdinal0 [0x00974546+1197382]\n\tGetHandleVerifier [0x00C59622+1619522]\n\tGetHandleVerifier [0x00D0882C+2336844]\n\tGetHandleVerifier [0x00B523E1+541697]\n\tGetHandleVerifier [0x00B51443+537699]\n\tOrdinal0 [0x00A5D18E+2150798]\n\tOrdinal0 [0x00A61518+2168088]\n\tOrdinal0 [0x00A61660+2168416]\n\tOrdinal0 [0x00A6B330+2208560]\n\tBaseThreadInitThunk [0x755EFA29+25]\n\tRtlGetAppContainerNamedObjectPath [0x77787A7E+286]\n\tRtlGetAppContainerNamedObjectPath [0x77787A4E+238]\n"}} __WD_Delete: URL=HTTP://127.0.0.1:9515/session/d5c403dd6f40c1ff1471f913cae480ab __WD_Delete: StatusCode=200; ResponseText={"value":null}... _WD_DeleteSession: {"value":null} +>00:03:21 AutoIt3.exe ended.rc:0 +>00:03:21 AutoIt3Wrapper Finished. >Exit code: 0 Time: 171.2 In the output, I found this: _WD_FindElement ==> No match: HTTP status = 404 Now I know, I couldn't address the correct thing correctly in the find element. But I don't know how to address this. If I just type the address, yeah it will work. But I wanted to manipulate a mouse click on that item. How can I do that?
  24. It seems that it worked now. Thank you. I'll see more if I have some more newb questions.
×
×
  • Create New...