Nine Posted December 17, 2020 Share Posted December 17, 2020 Running your script, I get it every time (after 3 runs) : Quote _WD_DeleteSession: {"value":null} 3 matching directories So, for the moment, I'll resolve my issue with this : _WD_DeleteSession($sSession) _WD_Shutdown() Local $aDir = _FileListToArray(@TempDir, "scoped_dir*", $FLTA_FOLDERS, True) Sleep(2000) For $i = 1 to $aDir[0] DirRemove($aDir[$i], $DIR_REMOVE) Next BTW, my tests were under Win7. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted December 17, 2020 Author Share Posted December 17, 2020 @Nine Interesting... I only have Win10 for testing. Are you using the latest Chromedriver? Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted December 17, 2020 Share Posted December 17, 2020 Yes I am using latest version. Quote Google Chrome est à jour Version 87.0.4280.88 (Build officiel) (64 bits) ChromeDriver 87.0.4280.88 But I think I am on something. When I run my script I can see there is 2 scoped_dir* folder created. One is effectively deleted but the other remains. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted December 18, 2020 Author Share Posted December 18, 2020 I see the same thing (2 directories), but both get deleted for me (at least the majority of the time) Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted December 18, 2020 Share Posted December 18, 2020 In the chrome.log, the scoped_dir* folder that is mentioned in the log file is the one that is not deleted. The other is not listed in the log. “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Nine Posted December 18, 2020 Share Posted December 18, 2020 Ok, one last empirical observation. After doing multiple tests (and I do not know how it happened), the chromedriver console was crashing (appearing a fraction of a sec), and then the second folder was not created, but the first was deleted. The script was completing normally, although it is a very short script. So I figure that it is the chromedriver that is creating the culprit folder. My impression it is using a shadow profile (but I may be totally wrong). “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Danp2 Posted December 18, 2020 Author Share Posted December 18, 2020 @Nine Sounds like you had a rogue copy of Chromedriver running, which will give the effect that you described where the console disappears (it can't access the port because it's already in use) yet the script still executes successfully Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Wo0ki3 Posted December 22, 2020 Share Posted December 22, 2020 Hello, I have started to work with WebDriver recently and I,m trying to automate it with my PAM solution. Right now, I probably stuck with XPath. The page is loading, but the pass and username are blank. #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession SetupChrome () _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://twitter.com/login") _ChromeSetInputValueById($sSession,'session[username_or_email]','test') _ChromeSetInputValueById($sSession,'session[password]','1321321321321231321321321') _WD_Shutdown() 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, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false }}}}' EndFunc Func _ChromeSetInputValueById($sSession,$Id,$Value) Local $sElement, $aElements, $sValue, $sButton, $sResponse, $bDecode, $sDecode, $hFileOpen $sButton = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//*[@id="react-root"]/div/div/div[2]/main/div/div/div[1]/form/div/div[1]/label/div/div[2]/div/input") _WD_ElemetAction($sSession,$sButton,'value', $Value) EndFunc Link to comment Share on other sites More sharing options...
Danp2 Posted December 22, 2020 Author Share Posted December 22, 2020 1 hour ago, Wo0ki3 said: _ChromeSetInputValueById This function is problematic because it doesn't perform any error checking. In your instance, it seems that someone has messed up the xpath portion of _WD_FindElement. I would recommend using a combination these functions instead -- _WD_GetElementById or _WD_GetElementByName _WD_SetElementValue Another issue is that you are trying to pass the element's name as it's ID, which doesn't work in this case. Here's my rewrite of your example -- #include "wd_core.au3" #include "wd_helper.au3" Local $sDesiredCapabilities, $sSession, $sElement SetupChrome () _WD_Startup() $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://twitter.com/login") $sElement = _WD_GetElementByName($sSession, "session[username_or_email]") If Not @error Then _WD_SetElementValue($sSession, $sElement, "test") $sElement = _WD_GetElementByName($sSession, "session[password]") If Not @error Then _WD_SetElementValue($sSession, $sElement, "1321321321321231321321321") _WD_Shutdown() 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, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false }}}}' EndFunc Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted January 2, 2021 Share Posted January 2, 2021 (edited) Hello @Danp2 happy new year mate. Do you know how to debug this message please ? _WD_IsLatestRelease: True _WD_IsLatestRelease ==> Success _WDStartup: OS: WIN_10 WIN32_NT 18363 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.3.1.0 (Up to date) _WDStartup: WinHTTP: 1.6.4.1 (Download latest source at <https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3>) _WDStartup: Driver: chromedriver.exe _WDStartup: Params: --verbose --log-path="C:\Users\Caramen\OneDrive\Autoit\Projet Menu contextuel\Menu contextuel 7.0\Final\chrome.log" _WDStartup: Port: 9515 __WD_Post: URL=HTTP://127.0.0.1:9515/session; $sData={"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false , "args":["--user-data-dir=C:\\Users\\Caramen\\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 [0x00B9C0C3+3326147]\n\tOrdinal0 [0x00A80851+2164817]\n\tOrdinal0 [0x00907298+619160]\n\tOrdinal0 [0x0087F1FC+61948]\n\tOrdinal0 [0x0087C38A+50058]\n\tOrdinal0 [0x008A5F3E+220990]\n\tOrdinal0 [0x008A5CAC+220332]\n\tOrdinal0 [0x008A189B+202907]\n\tOrdinal0 [0x00883DF4+81396]\n\tOrdinal0 [0x00884DEE+85486]\n\tOrdinal0 [0x00884D79+85369]\n\tOrdinal0 [0x00A985DC+2262492]\n\tGetHandleVerifier [0x00D22874+1487204]\n\tGetHandleVerifier [0x00D223CD+1486013]\n\tGetHandleVerifier [0x00D2A368+1518680]\n\tGetHandleVerifier [0x00D22F4E+1488958]\n\tOrdinal0 [0x00A8ED0D+2223373]\n\tOrdinal0 [0x00A9A12B+2269483]\n\tOrdinal0 [0x00A9A26F+2269807]\n\tOrdinal0 [0x00AAECB8+2354360]\n\tBaseThreadInitThunk [0x74B86359+25]\n\tRtlGetAppContainerNamedObjectPath [0x772E8944+228]\n\tRtlGetAppContainerNamedObjectPath [0x772E8914+180]\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 [0x00B9C0C3+3326147]\n\tOrdinal0 [0x00A80851+2164817]\n\tOrdinal0 [0x00907298+619160]\n\tOrdinal0 [0x0087F1FC+61948]\n\tOrdinal0 [0x0087C38A+50058]\n\tOrdinal0 [0x008A5F3E+220990]\n\tOrdinal0 [0x008A5CAC+220332]\n\tOrdinal0 [0x008A189B+202907]\n\tOrdinal0 [0x00883DF4+81396]\n\tOrdinal0 [0x00884DEE+85486]\n\tOrdinal0 [0x00884D79+85369]\n\tOrdinal0 [0x00A985DC+2262492]\n\tGetHandleVerifier [0x00D22874+1487204]\n\tGetHandleVerifier [0x00D223CD+1486013]\n\tGetHandleVerifier [0x00D2A368+1518680]\n\tGetHandleVerifier [0x00D22F4E+1488958]\n\tOrdinal0 [0x00A8ED0D+2223373]\n\tOrdinal0 [0x00A9A12B+2269483]\n\tOrdinal0 [0x00A9A26F+2269807]\n\tOrdinal0 [0x00AAECB8+2354360]\n\tBaseThreadInitThunk [0x74B86359+25]\n\tRtlGetAppContainerNamedObjectPath [0x772E8944+228]\n\tRtlGetAppContainerNamedObjectPath [0x772E8914+180]\n"}} _WD_CreateSession ==> Webdriver Exception: HTTP status = 400 __WD_Post: URL=HTTP://127.0.0.1:9515/session//url; $sData={"url":"https://xxxxxxxxxx&consigne=49030"} __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 [0x00B9C0C3+3326147]\n\tOrdinal0 [0x00A80851+2164817]\n\tOrdinal0 [0x00907140+618816]\n\tOrdinal0 [0x0088386D+79981]\n\tOrdinal0 [0x008A1967+203111]\n\tOrdinal0 [0x0089F771+194417]\n\tOrdinal0 [0x0089F3A5+193445]\n\tOrdinal0 [0x00872244+8772]\n\tOrdinal0 [0x00872746+10054]\n\tOrdinal0 [0x00872DA1+11681]\n\tOrdinal0 [0x00A985DC+2262492]\n\tGetHandleVerifier [0x00D22874+1487204]\n\tGetHandleVerifier [0x00D223CD+1486013]\n\tGetHandleVerifier [0x00D2A368+1518680]\n\tGetHandleVerifier [0x00D22F4E+1488958]\n\tOrdinal0 [0x00A8ED0D+2223373]\n\tOrdinal0 [0x00871FB2+8114]\n\tOrdinal0 [0x00871976+6518]\n\tGetHandleVerifier [0x00F1187C+3514732]\n\tBaseThreadInitThunk [0x74B86359+25]\n\tRtlGetAppContainerNamedObjectPath [0x772E8944+228]\n\tRtlGetAppContainerNamedObjectPath [0x772E8914+180]\n"}} _WD_Navigate: {"value":{"error":"invalid session id","message":"invalid session id","stacktrace":"Backtrace:\n\tOrdinal0 [0x00B9C0C3+3326147]\n\tOrdinal0 [0x00A80851+2164817]\n\tOrdinal0 [0x00907140+618816]\n\tOrdinal0 [0x0088386D+79981]\n\tOrdinal0 [0x008A1967+203111]\n\tOrdinal0 [0x0089F771+194417]\n\tOrdinal0 [0x0089F3A5+193445]\n\tOrdinal0 [0x00872244+8772]\n\tOrdinal0 [0x00872746+10054]\n\tOrdinal0 [0x00872DA1+11681]\n\tOrdinal0 [0x00A985DC+2262492]\n\tGetHandleVerifier [0x00D22874+1487204]\n\tGetHandleVerifier [0x00D223CD+1486013]\n\tGetHandleVerifier [0x00D2A368+1518680]\n\tGetHandleVerifier [0x00D22F4E+1488958]\n\tOrdinal0 [0x00A8ED0D+2223373]\n\tOrdinal0 [0x00871FB2+8114]\n\tOrdinal0 [0x00871976+6518]\n\tGetHandleVerifier [0x00F1187C+3514732]\n\tBaseThreadInitThunk [0x74B86359+25]\n\tRtlGetAppContainerNamedObjectPath [0x772E8944+228]\n\tRtlGetAppContainerNamedObjectPath [0x772E8914+180]\n"}} _WD_Navigate ==> Invalid session ID: HTTP status = 404 This is wd console : Starting ChromeDriver 87.0.4280.88 (89e2380a3e36c3464b5dd1302349b1382549290d-refs/branch-heads/4280@{#1761}) on port 9515 Only local connections are allowed. Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. [17796:13128:0102/170221.182:ERROR:cache_util_win.cc(20)] Unable to move the cache: AccÞs refusÚ. (0x5) [17796:13128:0102/170221.225:ERROR:cache_util.cc(140)] Unable to move cache folder C:\Users\Caramen\AppData\Local\Google\Chrome\User Data\ShaderCache\GPUCache to C:\Users\Caramen\AppData\Local\Google\Chrome\User Data\ShaderCache\old_GPUCache_000 [17796:13128:0102/170221.248:ERROR:disk_cache.cc(184)] Unable to create cache [17796:13128:0102/170221.286:ERROR:shader_disk_cache.cc(606)] Shader Cache Creation failed: -2 [10876:16736:0102/170221.402:ERROR:broker_win.cc(56)] Error reading broker pipe: Le canal de communication a ÚtÚ fermÚ. (0x6D) Ouverture dans une session de navigateur existante. It only happens If I try running chrome with my user profile. Without this arg it works. But _WD_NewTab isn't working anymore for me. Each time I add one line _WD_NewTab the browser won't start anyway. Even without the non-working capabilities Here is the code : SetupChrome() _WD_Startup() If @error <> $_WD_ERROR_Success Then MsgBox ( 64 , "Erreur" , "Erreur de lancement de chrome." ) EndIf $sSession = _WD_CreateSession($sDesiredCapabilities) Sleep (1500) _WD_Navigate($sSession, $URLLOC ) ;~ _WD_NewTab ( $sSession ) ;~ _WD_Navigate($sSession, $URLLOC ) 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, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false }}}}' ;~ $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false , "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"] }}}}' ;~ $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "excludeSwitches": [ "enable-automation"], "useAutomationExtension": false , "args":["--user-data-dir=C:\\Users\\' & @UserName & '\\AppData\\Local\\Google\\Chrome\\User Data\\", "--profile-directory=Default"] }}}}' EndFunc Edited January 2, 2021 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted January 2, 2021 Author Share Posted January 2, 2021 3 hours ago, caramen said: _WDStartup: WinHTTP: 1.6.4.1 (Download latest source at <https://raw.githubusercontent.com/dragana-r/autoit-winhttp/master/WinHttp.au3>) First thing you need to do is fix this. 3 hours ago, caramen said: "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" Then you need to investigate why it thinks something else, like another Chrome instance, is using this profile. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted January 4, 2021 Author Share Posted January 4, 2021 @caramen Responding to your DM here -- Those URLs don't resolve for me, which matches the output you are receiving -- __WD_Post ==> Webdriver Exception: {"value":{"error":"unknown error","message":"unknown error: net::ERR_NAME_NOT_RESOLVED\ P.S. Being able to read and analyze the log output is a valuable skill that you should spend some time developing 😉 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted January 4, 2021 Share Posted January 4, 2021 (edited) I'm sorry danp2 mate, It does not help me. How a URL that working, can not work if it's sent by WD ? What is the "resolving" issue ? It's look like a DNS problem. But how it can be DNS if it works when I enter url manually 😮 ? And of course I read the output of debug. But same as now it does not help me out so far. Edited January 4, 2021 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted January 4, 2021 Author Share Posted January 4, 2021 Yes, it looks like a DNS problem. You wouldn't know that without the logs, so stating that they haven't helped you is inaccurate. Granted, they can't magically fix your problems. However, they can sure point you towards a solution. As I stated above, those URLs don't resolve for me. If I were you, I would investigate how they resolve when you manually enter the URL. For instance -- Is a hosts file involved? Is a particular DNS server needed? Etc Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
caramen Posted January 4, 2021 Share Posted January 4, 2021 34 minutes ago, Danp2 said: Yes, it looks like a DNS problem. You wouldn't know that without the logs, so stating that they haven't helped you is inaccurate. Granted, they can't magically fix your problems. However, they can sure point you towards a solution. As I stated above, those URLs don't resolve for me. If I were you, I would investigate how they resolve when you manually enter the URL. For instance -- Is a hosts file involved? Is a particular DNS server needed? Etc I'm into a very very strange behavior AGAIN GRRRRR. Look I made my own newtab function like that for testing purpose : Func _WD_CaraNewTab ($UURLL = "Pas d'adresse") _WD_NewTab($sSession) Sleep(1000) Send("{F6}") Sleep(500) Send($UURLL) Send("{ENTER}") EndFunc So basically it opens a new tab. It pushes F6 to access address bar : Then typing the address with the send command. And then ENTER. It work. If I enter manually the address into WebDriver session it works too. Now what is not working. All of that.... If i do it into another function that one : expandcollapse popup;Line 148 : GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") ;Line 2163 : Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) If $WMNotifyTest = 1 Then ConsoleWrite ("; WMNotify () Is Working!!"&@CRLF) $WMNotifyTest += 1 EndIf #forceref $hWnd, $iMsg, $wParam Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo ; Local $tBuffer $hWndListView = $ConsoleArea If Not IsHWnd($ConsoleArea) Then $hWndListView = GUICtrlGetHandle($ConsoleArea) $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom")) $iIDFrom = DllStructGetData($tNMHDR, "IDFrom") $iCode = DllStructGetData($tNMHDR, "Code") Switch $hWndFrom Case $hWndListView Switch $iCode Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _DebugPrint("$NM_CLICK" & @CRLF & _ $TextFav = _GUICtrlListView_GetItemText($ConsoleArea, DllStructGetData($tInfo, "Index")) & _ "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; No return value Case $NM_DBLCLK ; Sent by a list-view control when the user double-clicks an item with the left mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) ;=================================================================================================== ;~ $URLLOCAL = _GUICtrlListView_GetItemText($ConsoleArea, DllStructGetData($tInfo, "Index")) ;~ $URLLOC = StringReplace ($URLLOCAL , "_" , "https://xxxxxxxxxxxxxxxxxxxxxxxxx?action=cons_view&" ) _WD_CaraNewTAb ($URLLOC) ;=================================================================================================== _DebugPrint("$NM_DBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; No return value Case $NM_RDBLCLK ; Sent by a list-view control when the user double-clicks an item with the right mouse button $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) _GUICtrlListView_DeleteItem($ConsoleArea, DllStructGetData($tInfo, "Index")) _FileWriteToLine ( @ScriptDir&"\Log.txt" , DllStructGetData($tInfo, "Index") , "" , True ) _FileWriteToLine ( @ScriptDir&"\Data\Log02.txt" , DllStructGetData($tInfo, "Index") , "" , True ) _FileWriteToLine ( @ScriptDir&"\Data\Log002.txt" , DllStructGetData($tInfo, "Index") , "" , True ) _FileWriteToLine ( @ScriptDir&"\Log.txt" , DllStructGetData($tInfo, "Index") , "" , True ) _FileWriteToLine ( @ScriptDir&"\Data\Log02.txt" , DllStructGetData($tInfo, "Index") , "" , True ) _FileWriteToLine ( @ScriptDir&"\Data\Log002.txt" , DllStructGetData($tInfo, "Index") , "" , True ) _FileWriteToLine ( @ScriptDir&"\Log.txt" , DllStructGetData($tInfo, "Index") , "" , True ) _FileWriteToLine ( @ScriptDir&"\Data\Log02.txt" , DllStructGetData($tInfo, "Index") , "" , True ) _FileWriteToLine ( @ScriptDir&"\Data\Log002.txt" , DllStructGetData($tInfo, "Index") , "" , True ) _DebugPrint("$NM_RDBLCLK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _ "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _ "-->Code:" & @TAB & $iCode & @CRLF & _ "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _ "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _ "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _ "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _ "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _ "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _ "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _ "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _ "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags")) ; No return value EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY If I replace $URLLOC by google.com or www.Google.com or https://www.google.fr / https://www.google.com Same issue 🙄 My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted January 4, 2021 Author Share Posted January 4, 2021 @caramen A few random items for you -- You quoted my post about troubleshooting the DNS issue, but then failed to address it. Did you investigate / resolve it? If so, what was the outcome? Are you aware that _WD_NewTab allows you to specify the URL for the new tab? Using Send() can be unreliable, which you should already know 🙁 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Nine Posted January 4, 2021 Share Posted January 4, 2021 As described in the Wiki : Warning: blocking of running user functions which executes window messages with commands such as "MsgBox" can lead to unexpected behavior, the return to the system should be as fast as possible! I do not know if that can be the issue... Danp2 1 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
caramen Posted January 4, 2021 Share Posted January 4, 2021 3 minutes ago, Danp2 said: @caramen A few random items for you -- You quoted my post about troubleshooting the DNS issue, but then failed to address it. Did you investigate / resolve it? If so, what was the outcome? Are you aware that _WD_NewTab allows you to specify the URL for the new tab? Using Send() can be unreliable, which you should already know 🙁 -From my understanding. If I test manually and it works. It's not a DNS problem. Because the URL is opening herself correctly. Anyway... I don't know how to investigate DNS problem. May if you tell me what could be needed to test/watch I'll do it instantly. -Yes but it does not work with your function. And it works with mine. And As I said this function was for testing purpose. It's useless to rewrite a working function to do same with the worst way. -Yes testing purpose.... 5 minutes ago, Nine said: As described in the Wiki : Warning: blocking of running user functions which executes window messages with commands such as "MsgBox" can lead to unexpected behavior, the return to the system should be as fast as possible! I do not know if that can be the issue... Does that main it could be the GuiRegisterMsg that cause this behavior ? I used WebDrivers a lot and first time I got trubles doing new tabs.... My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted January 4, 2021 Share Posted January 4, 2021 (edited) 17 minutes ago, Danp2 said: @caramen A few random items for you -- You quoted my post about troubleshooting the DNS issue, but then failed to address it. Did you investigate / resolve it? If so, what was the outcome? Are you aware that _WD_NewTab allows you to specify the URL for the new tab? Using Send() can be unreliable, which you should already know 🙁 -From my understanding. If I test manually and it works. It's not a DNS problem. Because the URL is opening herself correctly. Anyway... I don't know how to investigate DNS problem. May if you tell me what could be needed to test/watch I'll do it instantly. -Yes but it does not work with your function. And it works with mine. And As I said this function was for testing purpose. It's useless to rewrite a working function to do same with the worst way. -Yes testing purpose.... 17 minutes ago, Nine said: As described in the Wiki : Warning: blocking of running user functions which executes window messages with commands such as "MsgBox" can lead to unexpected behavior, the return to the system should be as fast as possible! I do not know if that can be the issue... Does that main it could be the GuiRegisterMsg that cause this behavior ? I used WebDrivers a lot and first time I got trubles doing new tabs.... This is what happen when I execute this function : Func _StartingChrome () SetupChrome() _WD_Startup() If @error <> $_WD_ERROR_Success Then MsgBox ( 64 , "Erreur" , "Erreur de lancement de chrome." ) EndIf $sSession = _WD_CreateSession($sDesiredCapabilities) _WD_Navigate($sSession, "https://google.fr") _WD_NewTab ( "https://google.fr" ) _WD_CaraNewTab ("https://xxxxxxxxxxxxx/HOMEPAGE.aspx") _WD_NewTab ("https://xxxxxxxxxxxx/HOMEPAGE.aspx") _WD_CaraNewTab ("https://xxxxxxxxxxxxxxxxxxxxx&consigne=49030") _WD_NewTab ("https://xxxxxxxxxxxxxxxxxxxxxxxxxx&consigne=49030") ;~ _WD_CaraNewTab ("https://xxxxxxxxxxxxxxxxxxxxxxx&consigne=49030") EndFunc Any attemp of calling _WD_NewTab = WD Crash. And it's not crashing only if I open the WD session then using newtab directly. Edited January 4, 2021 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
Danp2 Posted January 4, 2021 Author Share Posted January 4, 2021 2 minutes ago, caramen said: This is what happen when I execute this function : No idea what you are trying to say / do here 3 minutes ago, caramen said: _WD_NewTab ( "https://google.fr" ) This syntax is invalid P.S. If you want further assistance with this, I suggest that you post a short reproducer script that we can run (without modifications) to observe the issue. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts