Danp2 Posted July 4, 2019 Author Share Posted July 4, 2019 @Math43 Run wd_demo.au3 with the DemoElements option set to True. When the _ArrayDisplay popup is shown, close the browser window. Afterwards, close the popup and the script will continue. At this point, you should start to see errors logged in the Scite output panel such as -- __WD_Post: URL=HTTP://127.0.0.1:9515/session/d03ef849434f98c084cbad7829b1e1b1/element/5fa04ca6-3871-4a73-96ab-e7fd13065564/value; $sData={"id":"5fa04ca6-3871-4a73-96ab-e7fd13065564", "text":"testing 123"} __WD_Post: StatusCode=500; ResponseText={"value":{"error":"chrome not reachable","message":"(Session info: chrome=75.0.3770.100)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0040DB63+1432419]\n\tOrdinal0 [0x00388D81+888193]\n\tOrdinal0 [0x0032B761+505697]\n\tOrdinal0 [0x00324589+476553]\n\tOrdinal0 [0x00324B17+477975]\n\tOrdinal0 [0x00325B85+482181]\n\tOrdinal0 [0x00321A6F+465519]\n\tOrdinal0 [0x0032C670+509552]\n\tOrdinal0 [0x002E67B5+223157]\n\tOrdinal0 [0x002DE8AB+190635]\n\tOrdinal0 [0x002C5F16+89878]\n\tOrdinal0 [0x002C757A+95610]\n\tOrdinal0 [0x002C7474+95348]\n\tGetHandleVerifier [0x0056DE7C+1274156]\n\tGetHandleVerifier [0x004BB6D9+543113]\n\tGetHandleVerifier [0x004BB4E0+542608]\n\tOrdinal0 [0x0041B508+1488136]\n\tGetHandleVerifier [0x004BBC86+544566]\n\tOrdinal0 [0x0039EEC5+978629]\n\tOrdinal0 [0x003AB35B+1028955]\n\tOrdinal0 [0x003AB49F+1029279]\n\tOrdinal0 [0x003AA445+1025093]\n\tBaseThreadInitThunk [0x76750419+25]\n\tRtlGetAppContainerNamedObjectPath [0x77C6662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x77C665FD+189]\n"}} _WD_ElementAction: {"value":{"error":"chrome not reachable","message":"(Session info: chrome=75.0.3770.100)","stacktrac... _WD_ElementAction ==> Webdriver Exception: {"value":{"error":"chrome not reachable","message":"(Session info: chrome=75.0.3770.100)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0040DB63+1432419]\n\tOrdinal0 [0x00388D81+888193]\n\tOrdinal0 [0x0032B761+505697]\n\tOrdinal0 [0x00324589+476553]\n\tOrdinal0 [0x00324B17+477975]\n\tOrdinal0 [0x00325B85+482181]\n\tOrdinal0 [0x00321A6F+465519]\n\tOrdinal0 [0x0032C670+509552]\n\tOrdinal0 [0x002E67B5+223157]\n\tOrdinal0 [0x002DE8AB+190635]\n\tOrdinal0 [0x002C5F16+89878]\n\tOrdinal0 [0x002C757A+95610]\n\tOrdinal0 [0x002C7474+95348]\n\tGetHandleVerifier [0x0056DE7C+1274156]\n\tGetHandleVerifier [0x004BB6D9+543113]\n\tGetHandleVerifier [0x004BB4E0+542608]\n\tOrdinal0 [0x0041B508+1488136]\n\tGetHandleVerifier [0x004BBC86+544566]\n\tOrdinal0 [0x0039EEC5+978629]\n\tOrdinal0 [0x003AB35B+1028955]\n\tOrdinal0 [0x003AB49F+1029279]\n\tOrdinal0 [0x003AA445+1025093]\n\tBaseThreadInitThunk [0x76750419+25]\n\tRtlGetAppContainerNamedObjectPath [0x77C6662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x77C665FD+189]\n"}} If you close the tab instead of the window, then you get the following -- __WD_Post: URL=HTTP://127.0.0.1:9515/session/f21a0f2bee2cd40878ea85a3b01c76ea/element/75d77cac-be83-4271-94e7-53f04732b9ac/value; $sData={"id":"75d77cac-be83-4271-94e7-53f04732b9ac", "text":"testing 123"} __WD_Post: StatusCode=404; ResponseText={"value":{"error":"no such window","message":"window was already closed\n (Session info: chrome=75.0.3770.100)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0040DB63+1432419]\n\tOrdinal0 [0x00388D81+888193]\n\tOrdinal0 [0x0032B9D1+506321]\n\tOrdinal0 [0x0032502E+479278]\n\tOrdinal0 [0x00325B85+482181]\n\tOrdinal0 [0x00321A6F+465519]\n\tOrdinal0 [0x0032C670+509552]\n\tOrdinal0 [0x002E67B5+223157]\n\tOrdinal0 [0x002DE8AB+190635]\n\tOrdinal0 [0x002C5F16+89878]\n\tOrdinal0 [0x002C757A+95610]\n\tOrdinal0 [0x002C7474+95348]\n\tGetHandleVerifier [0x0056DE7C+1274156]\n\tGetHandleVerifier [0x004BB6D9+543113]\n\tGetHandleVerifier [0x004BB4E0+542608]\n\tOrdinal0 [0x0041B508+1488136]\n\tGetHandleVerifier [0x004BBC86+544566]\n\tOrdinal0 [0x0039EEC5+978629]\n\tOrdinal0 [0x003AB35B+1028955]\n\tOrdinal0 [0x003AB49F+1029279]\n\tOrdinal0 [0x003AA445+1025093]\n\tBaseThreadInitThunk [0x76750419+25]\n\tRtlGetAppContainerNamedObjectPath [0x77C6662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x77C665FD+189]\n"}} _WD_ElementAction: {"value":{"error":"no such window","message":"window was already closed\n (Session info: chrome=75.... _WD_ElementAction ==> Webdriver Exception: {"value":{"error":"no such window","message":"window was already closed\n (Session info: chrome=75.0.3770.100)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0040DB63+1432419]\n\tOrdinal0 [0x00388D81+888193]\n\tOrdinal0 [0x0032B9D1+506321]\n\tOrdinal0 [0x0032502E+479278]\n\tOrdinal0 [0x00325B85+482181]\n\tOrdinal0 [0x00321A6F+465519]\n\tOrdinal0 [0x0032C670+509552]\n\tOrdinal0 [0x002E67B5+223157]\n\tOrdinal0 [0x002DE8AB+190635]\n\tOrdinal0 [0x002C5F16+89878]\n\tOrdinal0 [0x002C757A+95610]\n\tOrdinal0 [0x002C7474+95348]\n\tGetHandleVerifier [0x0056DE7C+1274156]\n\tGetHandleVerifier [0x004BB6D9+543113]\n\tGetHandleVerifier [0x004BB4E0+542608]\n\tOrdinal0 [0x0041B508+1488136]\n\tGetHandleVerifier [0x004BBC86+544566]\n\tOrdinal0 [0x0039EEC5+978629]\n\tOrdinal0 [0x003AB35B+1028955]\n\tOrdinal0 [0x003AB49F+1029279]\n\tOrdinal0 [0x003AA445+1025093]\n\tBaseThreadInitThunk [0x76750419+25]\n\tRtlGetAppContainerNamedObjectPath [0x77C6662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x77C665FD+189]\n"}} You should be able to check the value of @error following the call to the UDF. Math43 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Danp2 Posted July 4, 2019 Author Share Posted July 4, 2019 5 hours ago, Letraindusoir said: The web source code get by using _WD_GetSource,it doesn't seem to be able to get the asynchronous loaded part, which can see from the web source code obtained by F12 devtools Figure out how to retrieve the desired code from the developer console. Once you've determined that, then you should be able to do it with _WD_ExecuteScript or perhaps _WD_FindElement and _WD_ElementAction Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Math43 Posted July 4, 2019 Share Posted July 4, 2019 1 hour ago, Danp2 said: @Math43 Run wd_demo.au3 with the DemoElements option set to True. When the _ArrayDisplay popup is shown, close the browser window. Afterwards, close the popup and the script will continue. At this point, you should start to see errors logged in the Scite output panel such as -- __WD_Post: URL=HTTP://127.0.0.1:9515/session/d03ef849434f98c084cbad7829b1e1b1/element/5fa04ca6-3871-4a73-96ab-e7fd13065564/value; $sData={"id":"5fa04ca6-3871-4a73-96ab-e7fd13065564", "text":"testing 123"} __WD_Post: StatusCode=500; ResponseText={"value":{"error":"chrome not reachable","message":"(Session info: chrome=75.0.3770.100)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0040DB63+1432419]\n\tOrdinal0 [0x00388D81+888193]\n\tOrdinal0 [0x0032B761+505697]\n\tOrdinal0 [0x00324589+476553]\n\tOrdinal0 [0x00324B17+477975]\n\tOrdinal0 [0x00325B85+482181]\n\tOrdinal0 [0x00321A6F+465519]\n\tOrdinal0 [0x0032C670+509552]\n\tOrdinal0 [0x002E67B5+223157]\n\tOrdinal0 [0x002DE8AB+190635]\n\tOrdinal0 [0x002C5F16+89878]\n\tOrdinal0 [0x002C757A+95610]\n\tOrdinal0 [0x002C7474+95348]\n\tGetHandleVerifier [0x0056DE7C+1274156]\n\tGetHandleVerifier [0x004BB6D9+543113]\n\tGetHandleVerifier [0x004BB4E0+542608]\n\tOrdinal0 [0x0041B508+1488136]\n\tGetHandleVerifier [0x004BBC86+544566]\n\tOrdinal0 [0x0039EEC5+978629]\n\tOrdinal0 [0x003AB35B+1028955]\n\tOrdinal0 [0x003AB49F+1029279]\n\tOrdinal0 [0x003AA445+1025093]\n\tBaseThreadInitThunk [0x76750419+25]\n\tRtlGetAppContainerNamedObjectPath [0x77C6662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x77C665FD+189]\n"}} _WD_ElementAction: {"value":{"error":"chrome not reachable","message":"(Session info: chrome=75.0.3770.100)","stacktrac... _WD_ElementAction ==> Webdriver Exception: {"value":{"error":"chrome not reachable","message":"(Session info: chrome=75.0.3770.100)","stacktrace":"Backtrace:\n\tOrdinal0 [0x0040DB63+1432419]\n\tOrdinal0 [0x00388D81+888193]\n\tOrdinal0 [0x0032B761+505697]\n\tOrdinal0 [0x00324589+476553]\n\tOrdinal0 [0x00324B17+477975]\n\tOrdinal0 [0x00325B85+482181]\n\tOrdinal0 [0x00321A6F+465519]\n\tOrdinal0 [0x0032C670+509552]\n\tOrdinal0 [0x002E67B5+223157]\n\tOrdinal0 [0x002DE8AB+190635]\n\tOrdinal0 [0x002C5F16+89878]\n\tOrdinal0 [0x002C757A+95610]\n\tOrdinal0 [0x002C7474+95348]\n\tGetHandleVerifier [0x0056DE7C+1274156]\n\tGetHandleVerifier [0x004BB6D9+543113]\n\tGetHandleVerifier [0x004BB4E0+542608]\n\tOrdinal0 [0x0041B508+1488136]\n\tGetHandleVerifier [0x004BBC86+544566]\n\tOrdinal0 [0x0039EEC5+978629]\n\tOrdinal0 [0x003AB35B+1028955]\n\tOrdinal0 [0x003AB49F+1029279]\n\tOrdinal0 [0x003AA445+1025093]\n\tBaseThreadInitThunk [0x76750419+25]\n\tRtlGetAppContainerNamedObjectPath [0x77C6662D+237]\n\tRtlGetAppContainerNamedObjectPath [0x77C665FD+189]\n"}} If you close the tab instead of the window, then you get the following --  You should be able to check the value of @error following the call to the UDF. Ok, thanks, if I understand well code in DemoElements, error are triggered because the next line of the code can be executed. The main purpose of my script is to auto login a user on a website and after user can manually use the website, so all my script have been already process and the closing of tab or browser can happen 5 min or 10hours after the end launch of the session. Is the solution you have proposed will work in my case ? Regards, Mathieu Link to comment Share on other sites More sharing options...
Danp2 Posted July 4, 2019 Author Share Posted July 4, 2019 @Math43 No, my suggestion would only work if the script has more actions to perform and you want to detect an error condition. Alternatively, you could try one of the following -- Set the variable $_WD_DEBUG equal to $_WD_DEBUG_None, which will prevent the console window from being shown when launched Use the function _WD_ConsoleVisible to hide or show the console as required Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Math43 Posted July 5, 2019 Share Posted July 5, 2019 17 hours ago, Danp2 said: @Math43 No, my suggestion would only work if the script has more actions to perform and you want to detect an error condition. Alternatively, you could try one of the following -- Set the variable $_WD_DEBUG equal to $_WD_DEBUG_None, which will prevent the console window from being shown when launched Use the function _WD_ConsoleVisible to hide or show the console as required Hi, Finaly I wrote the following script to anwser my needs: Func TrackChrome($iPidChromeDriver) Local $sWmicQuery Local $hWmicAnswer Local $iPidChromeBrowser Local $sOutput $sWmicQuery = 'wmic process where (ParentProcessId='&$iPidChromeDriver&' and Caption="chrome.exe") get ProcessId /format:VALUE' ; run your query hidden and with redirected I/O streams ;$hPiD = Run($sWMICquery, '', @SW_HIDE, $STDERR_MERGED) $hWmicAnswer = Run($sWmicQuery, '', @SW_HIDE, $STDERR_MERGED) Do Sleep(100) $sOutput &= StdoutRead($hWmicAnswer) ; get wmic output from redirected stream Until @error ; error occurs when command has finished ConsoleWrite($sOutput & @CRLF) $sOutput = StringStripWS($sOutput, $STR_STRIPALL) ; remove all @cr and spaces from output $array = StringSplit($sOutput, "=") $iPidChromeBrowser = $array[2] ConsoleWrite($iPidChromeBrowser & @CRLF) While ProcessExists($iPidChromeBrowser) Sleep(1000) Wend EndFunc To describe my function; I getting $iPidChromeDriver from _WD_CreateSession I use wmic to find PID of child process name "chrome.exe" I block my script in a loop with exist condition is process not exist anymore After my function I use _WD_DeleteSession($sSession) and _WD_Shutdown() Â Thanks you very much for your help DanP2 Just for information, event with _WD_ConsoleVisible set to true, WebDriver Console is still visible. Link to comment Share on other sites More sharing options...
Danp2 Posted July 5, 2019 Author Share Posted July 5, 2019 1 hour ago, Math43 said: Just for information, event with _WD_ConsoleVisible set to true, WebDriver Console is still visible. Perhaps you misunderstood how this function works. Here's a simple example -- _WD_ConsoleVisible(False) ; Hide console Sleep(5000) _WD_ConsoleVisible(True) ; Show console If this doesn't work for you, then I would request that you provide a short, runnable example script that demonstrates the issue. Also, I wanted to clarify my earlier statement -- Quote Set the variable $_WD_DEBUG equal to $_WD_DEBUG_None, which will prevent the console window from being shown when launched This must be done prior to calling _WD_Startup() for the console to be hidden on initial creation. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Letraindusoir Posted July 5, 2019 Share Posted July 5, 2019 (edited) <!-- Modal --> <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h4 class="modal-title" id="myModalLabel">Modal title</h4> </div> <div class="modal-body"> ... </div> <div class="modal-footer"> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal --> Take this modal box as an example. To get these three elements: <h4 class="modal-title" id="myModalLabel">Modal title</h4> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-primary">Save changes</button> As usual, after getting their respective xpath, then Get Them using _ WD_FindElement ($sSession,$_WD_LOCATOR_ByXPath, $xpath). I Want to ask two questions: 1, how to enumerate all the child elements of the element(<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">) through xpath or other methods? 2, after getting the element $sModal from local $sModal=_WD_FindElement ($sSession, "xpath", $class_currModal),   how to get the above three elements only with $sModal other than through their own Xpath? Edited July 5, 2019 by Letraindusoir Link to comment Share on other sites More sharing options...
Danp2 Posted July 5, 2019 Author Share Posted July 5, 2019 12 minutes ago, Letraindusoir said: after getting the element $sModal from local $sModal=_WD_FindElement ($sSession, "xpath", $class_currModal) Once you have the Modal element in $sModal, you can use this value for $sStartElement parameter of _WD_FindElement. Given the appropriate selector, you should be able to get all of the contained elements (when $lMultiple is True) or any individual one you desire. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Letraindusoir Posted July 5, 2019 Share Posted July 5, 2019 (edited) 43 minutes ago, Danp2 said: Once you have the Modal element in $sModal, you can use this value for $sStartElement parameter of _WD_FindElement. Given the appropriate selector, you should be able to get all of the contained elements (when $lMultiple is True) or any individual one you desire. thank you,Danp2! My goal is to find child elements unconditionally. That is, simply by virtue of the acquired parent element, enumerates all his child elements. If do not use $sStartElement parameter,Like the code below: local $arr=_ WD_FindElement ($sSession,$_WD_LOCATOR_ByXPath, '//*[@id="myModal"]',"",True) can't Enumerate the child elements. Edited July 5, 2019 by Letraindusoir Link to comment Share on other sites More sharing options...
Letraindusoir Posted July 5, 2019 Share Posted July 5, 2019 (edited) I don't have a thorough understanding of xpath syntax and I'm not very good at using it. What if using "_ WD_FindElement ($sSession,$_WD_LOCATOR_ByXPath, '//*[@id="myModal"]',$sStartElement,True)", how should i write the $sStartElement? Edited July 5, 2019 by Letraindusoir Link to comment Share on other sites More sharing options...
Danp2 Posted July 5, 2019 Author Share Posted July 5, 2019 @Letraindusoir I'm not an xpath expert either, so you may get better assistance by starting another thread or searching elsewhere on the web. 😀 However. you may be able to get what you're after with something like this -- $aElements = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, "//div[@id='myModal']//*", "", True)  Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TungNhoc Posted July 6, 2019 Share Posted July 6, 2019 Hi ! I try run js with webdriver $kq=   _WD_ExecuteScript($sSession,'document.getElementsByClassName("_54k8 _52jg _56bs _26vk _56b_ _3cqr _5uc2 _56bu")[0].click();',"") Msgbox (0,0,$kq) I try on Console (F12) on Chorme is good results ( document.getElementsByClassName("_54k8 _52jg _56bs _26vk _56b_ _3cqr _5uc2 _56bu")[0].click(); ) . If run with autoit is error : missing command parameters . Can you help me ?? Sorry my english very bad Link to comment Share on other sites More sharing options...
Danp2 Posted July 6, 2019 Author Share Posted July 6, 2019 @TungNhoc Probably has something to do with the double quotes in the string. Can't tell because you didn't provide the actual results from the Scite output panel. Also, what version of the UDF are you using? Latest published version is 0.1.0.19. Finally, there may be a better way to accomplish your goal besides using _WD_ExecuteScript. Suggest that you give move details on what you are trying to accomplish with this script. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TungNhoc Posted July 6, 2019 Share Posted July 6, 2019 48 minutes ago, Danp2 said: @TungNhoc Probably has something to do with the double quotes in the string. Can't tell because you didn't provide the actual results from the Scite output panel. Also, what version of the UDF are you using? Latest published version is 0.1.0.19. Finally, there may be a better way to accomplish your goal besides using _WD_ExecuteScript. Suggest that you give move details on what you are trying to accomplish with this script. OMG !! I used version 0.1.0.14 :D . I succeed , thank you Danp , Cám ơn Danp :D Link to comment Share on other sites More sharing options...
TungNhoc Posted July 7, 2019 Share Posted July 7, 2019 I have difficulty hiding command webdriver . You can help me ? Thank Link to comment Share on other sites More sharing options...
Danp2 Posted July 7, 2019 Author Share Posted July 7, 2019 (edited) @TungNhoc Please post a short, runnable script that demonstrates what you have tried. Also, review what I've posted here. P.S. I don't recall testing the new _WD_ConsoleVisible function with Chrome, so it's possible that it doesn't work properly with it. If so, I need to know so that I can determine a fix. Edit: Just tested it in Chrome and it worked as expected 😉 Edited July 7, 2019 by Danp2 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TungNhoc Posted July 7, 2019 Share Posted July 7, 2019 #include "wd_core.au3" #include "wd_helper.au3" #include "Array.au3" #include <File.au3> Global $sSession, $sDesiredCapabilities, $Toado = 1 _WD_ConsoleVisible (True) SetupChrome() Sleep (2000) _WD_Startup() $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":[' & """--blink-settings=imagesEnabled""," & " ""user-data-dir=D:\\ProfileZalo\\3""" & "" & "," & '"' & "--start-maximized" & '"' & ',' & '"--disable-notifications"' & '] }}}}' Sleep (2000) $sSession = _WD_CreateSession($sDesiredCapabilities) Sleep(3000) _WD_Navigate($sSession, "https://www.google.com/") Func SetupChrome() _WD_Option('Driver', 'chromedriver.exe') _WD_Option('Port', 9515) _WD_Option('DriverParams', '--log-path="' & @ScriptDir & '\chrome.log"') EndFunc ;==>SetupChrome ;@@@@@@@@@@@@@@@@@@@@@@@@ Func _WD_ElementValue($sKey, $Value) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sKey) _WD_ElementAction($sSession, $sElement, 'value', $Value) EndFunc ;==>_WD_ElementValue Func _WD_ElementClick($sKey) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sKey) _WD_ElementAction($sSession, $sElement, 'click') EndFunc ;==>_WD_ElementClick Func _WD_ElementClear($sKey) $sElement = _WD_FindElement($sSession, $_WD_LOCATOR_ByXPath, $sKey) _WD_ElementAction($sSession, $sElement, 'clear') EndFunc ;==>_WD_ElementClear Sorry ! I tried but still did not work Link to comment Share on other sites More sharing options...
Danp2 Posted July 7, 2019 Author Share Posted July 7, 2019 @TungNhoc The console doesn't exist until after the call to _WD_Startup(), so it doesn't make sense to call _WD_ConsoleVisible prior to that. Also, you'll want to pass False for the parameter instead of True if you want to hide the console. You could also issue the following command before calling _WD_Startup(), which will result in the console being automatically hidden -- $_WD_DEBUG = $_WD_DEBUG_None  Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
TungNhoc Posted July 8, 2019 Share Posted July 8, 2019 8 hours ago, Danp2 said: @TungNhoc The console doesn't exist until after the call to _WD_Startup(), so it doesn't make sense to call _WD_ConsoleVisible prior to that. Also, you'll want to pass False for the parameter instead of True if you want to hide the console. You could also issue the following command before calling _WD_Startup(), which will result in the console being automatically hidden -- $_WD_DEBUG = $_WD_DEBUG_None  i try but not working :( , i used udf ver V0.1.0.19 Global $sSession, $sDesiredCapabilities, $Toado = 1 SetupChrome() Sleep (2000) $_WD_DEBUG = $_WD_DEBUG_None _WD_Startup() $sDesiredCapabilities = '{"capabilities": {"alwaysMatch": {"goog:chromeOptions": {"w3c": true, "args":[' & """--blink-settings=imagesEnabled""," & " ""user-data-dir=D:\\ProfileZalo\\3""" & "" & "," & '"' & "--start-maximized" & '"' & ',' & '"--disable-notifications"' & '] }}}}' Sleep (2000) $sSession = _WD_CreateSession($sDesiredCapabilities) Sleep(3000) _WD_Navigate($sSession, "https://www.google.com/")  Link to comment Share on other sites More sharing options...
Danp2 Posted July 8, 2019 Author Share Posted July 8, 2019 @TungNhoc Sorry, but your description of "not working" isn't sufficient for us to help you. In addition, we can't test the script you posted because -- It's incomplete (missing includes and other functions) Your DesiredCapabilities contains a user profile directory that we won't have Please try again and make the effort to describe what is occurring. Dan Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Recommended Posts